Advertisement
Guest User

Untitled

a guest
Sep 18th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <?
  2.  
  3. if(isset($_POST["Submit"])) {
  4. $user = $_POST["Username"];
  5. $pass = $_POST["Password"];
  6. $repass = $_POST["RepeatPassword"];
  7. $email = $_POST["Email"];
  8.  
  9. $ini = file_get_contents("sql.ini");
  10. $sv = explode("_sv: ", $ini);
  11. $username = explode("_username: ", $ini);
  12. $password = explode("_pass: ", $ini);
  13. $conn = @mysqli_connect($sv, $username, $password);
  14.  
  15. if(!$conn) {
  16. die("Failed to connect to the MySQL Database: " . @mysqli_connect_error());
  17. }
  18.  
  19. $res = mysql_db_query("wizguin", 'SELECT FROM users WHERE Username="' . $user . '"');
  20.  
  21. if(@mysqli_num_rows($res) != 0) {
  22. die("That username already exists.");
  23. }
  24.  
  25. if($pass == $repass) {
  26. mysql_db_query("wizguin", 'INSERT INTO users (Username, Password, LoginKey, RegisteredTime, Buddies, Ignores, Inventory) VALUES ("' . $user . '", "' . $pass . '", "' . rand(0, 1000000) . 'i", "0", "[[]]", "[]", "[]")');
  27. @mysqli_close();
  28. echo "Successfully created an account! You can now log into it :)";
  29. #mail($email, "Wizguin Account", "Greetings! You have created an account for Wizguin! Your username is {$user}! Please come on and join the fun!");
  30. }
  31. }
  32.  
  33. else echo "Failed to register an account, please try again later.";
  34.  
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement