Advertisement
Guest User

Untitled

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