Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. <?php
  2.  
  3. echo "<h1>Register</h1>";
  4.  
  5. $submit = strip_tags($_POST['submit']);
  6. $fullname = strip_tags($_POST['fullname']);
  7. $username = strip_tags($_POST['username']);
  8. $password = md5(strip_tags($_POST['password']));
  9. $repeatpassword = md5(strip_tags($_POST['repeatpassword']));
  10. $date = date ("Y-m-d");
  11.  
  12.  
  13. if ($submit)
  14.  
  15. { //1
  16.  
  17.  
  18.  
  19.  
  20.  
  21. // check for existing details
  22. if ($fullname&&$username&&$password&&$repeatpassword)
  23.  
  24. { // 2
  25.  
  26. $password = md5($password);
  27. $repeatpassword = md5 ($repeatpassword);
  28.  
  29. } // 2
  30. if ($password==$repeatpassword)
  31. { // 3
  32.  
  33. } // 3
  34. else
  35.  
  36. echo "your passwords do not match";
  37.  
  38.  
  39. if (strlen($username)>25||strlen ($fullname)>25)
  40. { // 4
  41.  
  42. echo "Max char is 25";
  43. } // 4
  44. else
  45.  
  46.  
  47.  
  48. // check username length
  49. if (strlen($password)>25||strlen($password)<6)
  50. { // 5
  51. echo "password must be between 6-25 characters";
  52. } // 5
  53. else
  54.  
  55.  
  56.  
  57. //register user
  58. // was ere
  59.  
  60.  
  61. }
  62.  
  63.  
  64.  
  65.  
  66.  
  67. ?>
  68.  
  69. <html>
  70. <form action ='register.php' method ='POST'>
  71. <table>
  72.  
  73. <tr>
  74.  
  75. <td>
  76. Your full name:
  77. </td>
  78.  
  79. <td>
  80. <input type ='text' name='fullname'>
  81.  
  82. </td>
  83.  
  84. </tr>
  85.  
  86. <tr>
  87.  
  88. <td>
  89. Username
  90. </td>
  91.  
  92. <td>
  93. <input type ='text' name='username'>
  94.  
  95. </td>
  96.  
  97. </tr>
  98. <tr>
  99.  
  100. <td>
  101. Password:
  102. </td>
  103.  
  104. <td>
  105. <input type ='password' name='password'>
  106.  
  107. </td>
  108.  
  109. </tr>
  110. <tr>
  111.  
  112. <td>
  113. Password (Repeat)
  114. </td>
  115.  
  116. <td>
  117. <input type ='password' name='repeatpassword'>
  118.  
  119. </td>
  120.  
  121. </tr>
  122. </table>
  123. <p>
  124. <input type ='submit' name='submit' value='submit'>
  125.  
  126. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement