Advertisement
Guest User

Untitled

a guest
Jul 5th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. * Coded by `P R O D I G Y™
  5. * @copyright 2011 - InterBB
  6. * This source is released as free, under the GNU-GPL License.
  7. */
  8.  
  9. require("header.php");
  10. require("include/functions.php");
  11.  
  12. $username = clean($_POST['username']);
  13. $password = hash('sha512', md5($_POST['password2']).$salt);
  14. $salt = salt(rand(5, 9));
  15. $password_repeat = hash('sha512', md5($_POST['password2']).$salt);
  16. $email = strtolower(clean($_POST['email']));
  17. $registration_IP = $_SERVER['REMOTE_ADDR'];
  18. $registration_Date = date("m-d-Y, H:i", time());
  19.  
  20. if (isset($_POST['username']) && (count($_POST['username']) > 3) && isset($_POST['password']) && isset($_POST['password2']) && isset($_POST['email']) && isset($_POST['Agree'])) {
  21. $insert_query = 'insert into users (username, password, salt, email, registration_IP, registration_Date)
  22. values(
  23. "'.$username.'",
  24. "'.$password.'",
  25. "'.$salt.'",
  26. "'.$email.'",
  27. "'.$registration_IP.'",
  28. "'.$registration_Date.'"
  29. )';
  30.  
  31. if($password != $password_repeat) {
  32. displayError("Passwords don't match");
  33. }
  34. if(!isset($username)) {
  35. displayError("You must supply a username.");
  36. }
  37. if(!isset($password)) {
  38. displayError("You must supply a password.");
  39. }
  40. if(!isset($email)) {
  41. displayError("You must supply an email.");
  42. }
  43.  
  44. displaySuccess("Your account was successfully created, welcome to our forums.");
  45. mysql_query($insert_query) or die("<b>InterBB Error</b> : " . mysql_error());
  46. }
  47.  
  48. if(!isset($_POST['Agree'])) {
  49. displayError("You must agree to our <a href=\"#\">Terms of Service</a> to be a member of this community.");
  50. }
  51.  
  52. ?>
  53.  
  54. <form name="input" action="register.php" method="post">
  55. Username: <input type="text" name="username" /><br />
  56. Email: <input type="text" name="email" /><br />
  57. Password: <input type="password" name="password" /><br />
  58. Password Again: <input type="password" name="password2" /><br /><br />
  59. <input type="checkbox" name="Agree" value="Agree">I agree to the <a href="#">Terms of Service</a>.<br /><br />
  60. <input type="submit" value="Register Account" />
  61. </form>
  62.  
  63. <?php
  64. require("footer.php");
  65. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement