Guest User

Untitled

a guest
Nov 24th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. <?php
  2. include 'forum/connect.php';
  3. include ("register.htm");
  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. if($_SERVER['REQUEST_METHOD'] == "POST")
  18. {
  19. //check for existence
  20. if ($fullname && $username && $password && $repeatpassword && $email)
  21. {
  22. if ($password==$repeatpassword)
  23. {
  24. if (strlen($username)>50||(strlen($username)<6))
  25. {
  26. echo "Length of username is too long";
  27. }
  28. else
  29. {
  30. if (strlen($password)<6)
  31. {
  32. echo "Your password must be of 6 or more characters";
  33. }
  34. else
  35. {
  36. $password = sha1($password);
  37. $repeatpassword = sha1($repeatpassword);
  38. $sql = "INSERT INTO users (fullname, username, password, date, steam, xfire, email) VALUES ('$fullname', '$username', '$password', '$date', '$steam', '$xfire', '$email')";
  39. $queryreg = mysqli_query($link, $sql) or die(mysqli_error($link));
  40. die ("You have been registered");
  41. }
  42. }
  43. }
  44. else
  45. echo "Your passwords do not match";
  46. }
  47. else
  48. echo "Please fill in all fields";
  49. }
  50.  
  51.  
  52. ?>
  53.  
  54. <html>
  55. <p>
Add Comment
Please, Sign In to add comment