Guest User

Untitled

a guest
Oct 22nd, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1. <?php
  2. echo "<h1>Register</h1>";
  3.  
  4. //form data
  5. if($_SERVER['REQUEST_METHOD'] == "POST") //This code works,nothing else does!
  6. {
  7. $fullname = strip_tags($_POST['fullname']);
  8. $username = strip_tags($_POST['username']);
  9. $password = strip_tags($_POST['password']);
  10. $repeatpassword = strip_tags($_POST['repeatpassword']);
  11. $email = strip_tags($_POST['email']);
  12. $steam = strip_tags($_POST['steam']);
  13. $xfire = strip_tags($_POST['xfire']);
  14. $date = date("Y-m-d");
  15.  
  16. }
  17.  
  18. if($_SERVER['REQUEST_METHOD'] == "POST")
  19.  
  20. //Check for existance
  21. if ($username&&$password&&$repeatpassword&&$fullname&&$email)
  22. {
  23.  
  24. //Encrypt password
  25.  
  26. $password = md5($password);
  27. $repeatpassword = md5($repeatpassword);
  28.  
  29. if ($password==$repeatpassword)
  30. {
  31.  
  32. //Check character length of username and fullname
  33. if (strlen($username)>25||strlen($fullname)>25)
  34. {
  35. echo "Length of username or fullname is too long!";
  36. }
  37. else
  38. {
  39.  
  40. //Check password length
  41. if (strlen($password)>25||strlen($password)<6)
  42. {
  43. echo "Password must be between 6 and 25 characters";
  44. }
  45. else
  46. {
  47.  
  48. //register user
  49.  
  50. echo "Success";
  51.  
  52.  
  53. }
  54.  
  55.  
  56. }
  57.  
  58. }
  59. else
  60. echo "Your passwords do not match";
  61.  
  62. }
  63. else
  64. echo ("Please fill in all the fields");
  65.  
  66.  
  67. ?>
  68.  
  69. <html>
  70. <p>
  71. <h1>Fields marked with * are optional</h1>
  72. <form action='register.php' method='POST'>
  73. <table>
  74. <tr>
  75. <td>
  76. Your Full Name:
  77. </td>
  78.  
  79. <td>
  80. <input type='text' name='fullname'>
  81. <input type='hidden' name='action' value='hiddenvalue'>
  82. </td>
  83. </tr>
  84. </table>
  85.  
  86.  
  87. <table>
  88. <tr>
  89. <td>
  90. Choose a username:
  91. </td>
  92.  
  93. <td>
  94. <input type='text' name='username'>
  95. <input type='hidden' name='action' value='hiddenvalue'>
  96. </td>
  97. </tr>
  98. </table>
  99.  
  100.  
  101. <table>
  102. <tr>
  103. <td>
  104. Choose a password:
  105. </td>
  106.  
  107. <td>
  108. <input type='password' name='password'>
  109. <input type='hidden' name='action' value='hiddenvalue'>
  110. </td>
  111. </tr>
  112. </table>
  113.  
  114. <table>
  115. <tr>
  116. <td>
  117. Confirm password:
  118. </td>
  119.  
  120. <td>
  121. <input type='password' name='repeatpassword'>
  122. <input type='hidden' name='action' value='hiddenvalue'>
  123. </td>
  124. </tr>
  125. </table>
  126.  
  127.  
  128. <table>
  129. <tr>
  130. <td>
  131. Email:
  132. </td>
  133.  
  134. <td>
  135. <input type='text' name='email'>
  136. <input type='hidden' name='action' value='hiddenvalue'>
  137. </td>
  138. </tr>
  139. </table>
  140.  
  141. <table>
  142. <tr>
  143. <td>
  144. Steam ID:
  145. </td>
  146.  
  147. <td>
  148. <input type='text' name='steam'>
  149. <input type='hidden' name='action' value='hiddenvalue'>
  150. </td>
  151. </tr>
  152. </table>
  153.  
  154.  
  155. <table>
  156. <tr>
  157. <td>
  158. Xfire ID:
  159. </td>
  160.  
  161. <td>
  162. <input type='text' name='xfire'>
  163. <input type='hidden' name='action' value='register'>
  164. </td>
  165. </tr>
  166. </table>
  167. <p>
  168. <input type='submit' value='Register'>
  169. </p>
Add Comment
Please, Sign In to add comment