Advertisement
Guest User

Untitled

a guest
Jul 10th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. <?php
  2. echo "<h1>Register</h1>";
  3. error_reporting(0);
  4. if (isset($_POST["submit"]))
  5. {
  6. $submit=$_POST['submit'];
  7. $fullname=strip_tags($_POST['fullname']);// strip_tags=מוציא את כל האפשרויות לשימוש באטמל בתוך השדות
  8. $username=strip_tags($_POST['username']);
  9. $password=strip_tags($_POST['password']);
  10. $password2=strip_tags($_POST['password2']);
  11. $date=date("Y-m-d");
  12. // בודק אם הכניסו את כל השדות
  13. if($fullname == TRUE || $username == TRUE || $password == TRUE || $password2 == TRUE)
  14. {
  15. //מצפין את הסיסמא
  16. $password_m=md5($password);
  17. $password2_m=md5($password2);
  18. if ($password==$password2)
  19. {
  20. if (strlen($username)>25||strlen($fullname)>25)
  21. {
  22. echo "Max limit for Username / Fullname are 25 characters";
  23. }
  24.  
  25. if (strlen($password_m) > 25 || strlen($password_m) < 6){
  26. echo "Password must be between 6 and 25 characters.";
  27. }
  28. else
  29. {
  30. echo "Your passwords do not match.";
  31. }
  32. }
  33. else
  34. {
  35. echo "Please fill in <b>all</b> fields!";
  36. }
  37.  
  38. }
  39. }
  40. ?>
  41. <html>
  42.  
  43. <form action="register.php" method="post">
  44.  
  45.  
  46. <table>
  47.  
  48. <tr>
  49. <td>Full Name:</td>
  50. <td><input type='text' name='fullname'/></td>
  51. </tr>
  52. <tr>
  53. <td>Username:</td>
  54. <td><input type='text' name='username'/></td>
  55. </tr>
  56. <tr>
  57. <td>Password:</td>
  58. <td><input type='password' name='password'/></td>
  59. </tr>
  60. <tr>
  61. <td>Confirm Password:</td>
  62. <td><input type='password' name='password2'/></td>
  63. </tr>
  64.  
  65. </table>
  66. <p><input type='submit' name='submit' value='Register'/></p>
  67.  
  68. </form>
  69.  
  70. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement