Guest User

Untitled

a guest
Nov 1st, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. <?php
  2. include ("register.htm");
  3. include 'forum/connect.php';
  4.  
  5. //form data
  6. if($_SERVER['REQUEST_METHOD'] == "POST") //This code works,nothing else does!
  7. {
  8. $fullname = strip_tags($_POST['fullname']);
  9. $username = strip_tags($_POST['username']);
  10. $password = strip_tags($_POST['password']);
  11. $repeatpassword = strip_tags($_POST['repeatpassword']);
  12. $email = strip_tags($_POST['email']);
  13. $steam = strip_tags($_POST['steam']);
  14. $xfire = strip_tags($_POST['xfire']);
  15. $date = date("Y-m-d");
  16. }
  17.  
  18. if($_SERVER['REQUEST_METHOD'] == "POST")
  19. {
  20. //check for existence
  21. if ($fullname&&$username&&$password&&$repeatpassword&&$email)
  22. {
  23. if ($password==$repeatpassword)
  24. {
  25. if (strlen($username)>50||(strlen($username)<6))
  26. {
  27. echo "Length of username is too long";
  28. }
  29. else
  30. {
  31. if (strlen($password)<6)
  32. {
  33. echo "Your password must be of 6 or more characters";
  34. }
  35. else
  36. {
  37. $password = md5($password);
  38. $repeatpassword = md5($repeatpassword);
  39.  
  40. $queryreg = mysql_query("INSERT INTO users (fullname, username, password, date, steam, xfire, email) VALUES ('$fullname', '$username', '$password', '$date', '$steam', '$xfire', '$email')") or die(mysql_error());
  41. die ("You have been registered");
  42. }
  43. }
  44. }
  45. else
  46. echo "Your passwords do not match";
  47. }
  48. else
  49. echo "Please fill in all fields";
  50. }
  51.  
  52.  
  53. ?>
  54.  
  55. <html>
  56. <p>
Add Comment
Please, Sign In to add comment