Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.58 KB | None | 0 0
  1. <?php
  2.   $fullname = strip_tags($_POST['fullname']);
  3.   $username = strip_tags($_POST['username']);
  4.   $password = strip_tags($_POST['password']);
  5.   $repeatpassword = strip_tags($_POST['repeatpassword']);
  6.   $date = date("Y-m-d");
  7.   $submit = $_POST['submit'];
  8.  
  9.  
  10.   if ($submit) {
  11.  
  12.       if ($username&&$password&&$fullaname&&$repeatpassword) {
  13.           // encrypt pass
  14.         $password = md5($password);
  15.         $repeatpassword = md5($repeatpassword);
  16.  
  17.             if ($password==$repeatpassword) {
  18.                 if (strlen($username)>25||strlen($fullname)>25) {
  19.  
  20.                   echo "Length of username of fullname is too long!";
  21.  
  22.                   }
  23.                  else {
  24.  
  25.                      if (strlen($password)>25||strlen($password)<6) {
  26.  
  27.                          echo "Password must be between 6 and 25 characters";
  28.  
  29.                      }
  30.                      else {
  31.  
  32.                          //register the user
  33.                         echo "success!";
  34.                      }
  35.  
  36.                  }
  37.              }
  38.     else
  39.     echo "Your passwords do not match!";
  40.  
  41.       }
  42.           else "Please fill in <b>all</b> fields!";
  43.   }
  44.  
  45.  
  46. ?>
  47.  
  48. <html>
  49. <head>
  50.    <p>
  51. </head>
  52.  
  53. <body>
  54.  
  55. <form action='register.php' method='post'>
  56.  
  57.     <table>
  58.     <tr>
  59.     <td>
  60.         Your full name:
  61.     </td>
  62.     <td>
  63.     <input type='text' name='fullname'>
  64.     </td>
  65.         </tr>
  66.         <tr>
  67.         <td>
  68.         Choose a username:
  69.         </td>
  70.         <td>
  71.         <input type='text' name='username'>
  72.         </td>
  73.         </tr>
  74.         <tr>
  75.         <td>
  76.         Choose a password:
  77.         </td>
  78.         <td>
  79.         <input type='password' name='password'>
  80.         </td>
  81.         </tr>
  82.         <tr>
  83.         <td>
  84.         Repeat password:
  85.         </td>
  86.         <td>
  87.         <input type='password' name='repeatpassword'>
  88.         </td>
  89.         </tr>
  90.     </table>
  91.  
  92.  <input type='submit' name='submit' value='Register'>
  93. </form>
  94.  
  95. </body>
  96.  
  97. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement