Guest User

asdsadsa

a guest
Aug 16th, 2011
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.80 KB | None | 0 0
  1. <html>
  2. <body>
  3. <?php
  4. echo "Register!";
  5.  
  6. $submit = $_submit['submit'];
  7. $fullname = strip_tags($_POST['fullname']);
  8. $password = strip_tags($_POST['password']);
  9. $passwordrepeat = strip_tags($_POST['passwordrepeat']);
  10. $username = strip_tags($_POST['username']);
  11. $email = strip_tags($_POST['email']);
  12. $date = date("Y-m-d");
  13. $connect = mysql_connect("hidden","hidden","hidden") or die("Couldn't connect to server!");
  14. $lastid = mysql_query("SELECT id FROM users WHERE username='$username'");
  15. mysql_select_db("hidden") or die ("Unable to find database!");
  16. $namecheck = mysql_query("SELECT username FROM users WHERE username='$username'");
  17. $count = mysql_num_rows($namecheck);
  18. $activated = '1';
  19. $random = rand(1,999999999);
  20.  
  21. if ($submit)
  22. {
  23.     if ($count!=0)
  24.     {
  25.         if($username && $password && $passwordrepeat && $fullname && $email)
  26.         {
  27.             if (strlen($fullname)>255)
  28.             {
  29.                 if (strlen($username)>25)
  30.                 {
  31.                     if (strlen($password)>25||strlen($passwordrepeat)<6)
  32.                     {
  33.                         if ($password==$passwordrepeat)
  34.                         {
  35.                             $passwordresend = $password;
  36.                             $password = md5($_POST['password']);
  37.                             $passwordrepeat = md5($_POST['passwordrepeat']);
  38.                             $queryreg = mysql_query("INSERT INTO users ('id','username','password','email','name','time','passwordresend','randnum','activated') VALUES('','$username','$password','$email','$fullname','$date','$passwordresend','$random','$activated')");
  39.  
  40. //this code never happens for some reason ...
  41. //this code never happens for some reason ...
  42. //this code never happens for some reason ...
  43. //this code never happens for some reason ...
  44. //this code never happens for some reason ...
  45.  
  46.                                 echo "Registration Complete!";
  47.                                 die();
  48.                         }
  49.                             die("The passwords does not match!");
  50.                     }
  51.                         die("Your password must be between 6 and 25 characters!");
  52.                 }
  53.                     die("Your username is too long!");
  54.             }
  55.                 die("Your fullname is too long!");
  56.         }
  57.             die("Please enter <b>all</b> values!");
  58.     }
  59.         die("Username already taken!");    
  60. }
  61.  
  62. ?>
  63. <form action='register.php' method='POST'>
  64. <p>
  65.     <table>
  66.         <tr>
  67.             <td>
  68.                     Your full name:
  69.             </td>
  70.             <td>
  71.                 <input type='text' name='fullname' value='<?php echo $fullname ?>'>
  72.             </td>
  73.         </tr>
  74.         <tr>
  75.             <td>
  76.                 Your E-mail:
  77.             </td>
  78.             <td>
  79.                 <input type='text' name='email' value='<?php echo $email ?>'>
  80.             </td>
  81.         </tr>
  82.         <tr>
  83.             <td>
  84.                 Username:
  85.             </td>
  86.             <td>
  87.                 <input type='text' name='username' value='<?php echo $username ?>'>
  88.             </td>
  89.         </tr>
  90.         <tr>
  91.             <td>
  92.                 Password:
  93.             </td>
  94.             <td>
  95.                 <input type='password' name='password'>
  96.             </td>
  97.         </tr>
  98.         <tr>
  99.             <td>
  100.                 Repeat password:
  101.             </td>
  102.             <td>
  103.                 <input type='password' name='passwordrepeat'>
  104.             </td>
  105.         </tr>
  106.     </table>
  107. <p>
  108. <input type='submit' name='submit' value='Register'>
  109. </body>
  110. </html>
Advertisement
Add Comment
Please, Sign In to add comment