Guest User

Untitled

a guest
Oct 24th, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.70 KB | None | 0 0
  1. <?php
  2.  
  3. echo "<h1>Register</h1>";
  4.  
  5. $submit = strip_tags($_POST['submit']);
  6.  
  7. $fullname = strip_tags($_POST['fullname']);
  8. $username = strip_tags($_POST['username']);
  9.  
  10. $password =strip_tags($_POST['password']);
  11. $repeatpassword = strip_tags($_POST['repeatpassword']);
  12.  
  13. $date = ("Y-m-d");
  14.  
  15. if ($submit) {
  16.  
  17.     // Check to see if they are in database already
  18.     if($fullname&&$username&&$$$password&&$repeatpassword) {
  19.    
  20.         $password = md5($password);
  21.         $repeatpassword = md5($repeatpassword);
  22.        
  23.         if ($password==$repeatpassword) {
  24.  
  25.             // check char lenght of username and fullname
  26.             if (strlen($username)>25||strlen($fullname)>25)
  27.                 {
  28.                     echo "Full name or Username is too long!";
  29.                 }
  30.                 else
  31.                 {
  32.                     // check lenght of password
  33.                     if (strlen($password)>25||strlen($password)<8)
  34.                     {
  35.                         echo "Password <strong>Must</strong> be between 8 and 25 characters";
  36.                        
  37.                     }
  38.                     else {
  39.                     // Register Users
  40.                    
  41.                     }
  42.                    
  43.                 }
  44.         }
  45.         else
  46.             echo "Your password don't match!";
  47.     }
  48.     else
  49.         echo "Please fill in <strong>all</strong> fields.";
  50. }
  51.  
  52. ?>
  53.  
  54. <!DOCTYPE html>
  55. <html lang="">
  56. <head>
  57.   <meta charset="utf-8">
  58.     <title></title>
  59.     <meta name="description" content="" />  
  60.     <meta name="keywords" content="" />
  61.     <meta name="robots" content="" />
  62. </head>
  63. <body>
  64.  
  65.     <form action='register.php' method='post'>
  66.         <label>Full Name</label><input type='text' name='fullname'>
  67.         <label>Choose Username</label><input type='text' name='username'>
  68.         <label>Choose Password</label><input type='password' name='password'>
  69.         <label>Repeat Password</label><input type='password' name='repeatpassword'>
  70.         <input type='submit' name='submit' value='Register'>
  71.     </form>
  72.  
  73. </body>
  74. </html>
Add Comment
Please, Sign In to add comment