Guest User

Untitled

a guest
Aug 10th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. <?php
  2. require_once("../style/style.php");
  3. $subbtn = $_POST["subbtn"];
  4. $username = $_POST["username"];
  5. $password = $_POST["password"];
  6. $email = $_POST["email"];
  7. $username = mysql_real_escape_string($username, db_connect_select());
  8. $password = mysql_real_escape_string($password, db_connect_select());
  9. $email = mysql_real_escape_string($email, db_connect_select());
  10. $email = strtolower($email);
  11. $password = md5(md5($password));
  12. if(!$_SESSION["loggedin"]) {
  13. if(!$username) {
  14. header("Location: index.php?err=1");
  15. } elseif(!$password) {
  16. header("Location: index.php?err=2");
  17. } elseif(!$email) {
  18. header("Location: index.php?err=5");
  19. } else {
  20. $quser = mysql_query("SELECT * FROM `users` WHERE username='$username'", db_connect_select());
  21. mysql_close($link);
  22. $link = false;
  23. if(!mysql_num_rows($quser)) {
  24. mysql_query("INSERT INTO `users` (username, password, email) VALUES ('$username', '$password', '$email')", db_connect_select());
  25. mysql_close($link);
  26. $link = false;
  27. header("Location: success.php");
  28. } else {
  29. header("Location: index.php?err=3");
  30. }
  31. }
  32. } else {
  33. header("Location: index.php?err=4");
  34. }
  35. ?>
Add Comment
Please, Sign In to add comment