Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.57 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.                                 echo "Registration Complete!";
  40.                                 die();
  41.                         }
  42.                             die("The passwords does not match!");
  43.                     }
  44.                         die("Your password must be between 6 and 25 characters!");
  45.                 }
  46.                     die("Your username is too long!");
  47.             }
  48.                 die("Your fullname is too long!");
  49.         }
  50.             die("Please enter <b>all</b> values!");
  51.     }
  52.         die("Username already taken!");    
  53. }
  54.  
  55. ?>
  56. <form action='register.php' method='POST'>
  57. <p>
  58.     <table>
  59.         <tr>
  60.             <td>
  61.                     Your full name:
  62.             </td>
  63.             <td>
  64.                 <input type='text' name='fullname' value='<?php echo $fullname ?>'>
  65.             </td>
  66.         </tr>
  67.         <tr>
  68.             <td>
  69.                 Your E-mail:
  70.             </td>
  71.             <td>
  72.                 <input type='text' name='email' value='<?php echo $email ?>'>
  73.             </td>
  74.         </tr>
  75.         <tr>
  76.             <td>
  77.                 Username:
  78.             </td>
  79.             <td>
  80.                 <input type='text' name='username' value='<?php echo $username ?>'>
  81.             </td>
  82.         </tr>
  83.         <tr>
  84.             <td>
  85.                 Password:
  86.             </td>
  87.             <td>
  88.                 <input type='password' name='password'>
  89.             </td>
  90.         </tr>
  91.         <tr>
  92.             <td>
  93.                 Repeat password:
  94.             </td>
  95.             <td>
  96.                 <input type='password' name='passwordrepeat'>
  97.             </td>
  98.         </tr>
  99.     </table>
  100. <p>
  101. <input type='submit' name='submit' value='Register'>
  102. </body>
  103. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement