Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- if(isset($_POST["Submit"])) {
- $user = $_POST["Username"];
- $pass = $_POST["Password"];
- $repass = $_POST["RepeatPassword"];
- $email = $_POST["Email"];
- $ini = file_get_contents("sql.ini");
- $sv = explode("_sv: ", $ini);
- $username = explode("_username: ", $ini);
- $password = explode("_pass: ", $ini);
- $conn = @mysqli_connect($sv, $username, $password);
- if(!$conn) {
- die("Failed to connect to the MySQL Database: " . @mysqli_connect_error());
- }
- $res = mysql_db_query("wizguin", 'SELECT FROM users WHERE Username="' . $user . '"');
- if(@mysqli_num_rows($res) != 0) {
- die("That username already exists.");
- }
- if($pass == $repass) {
- mysql_db_query("wizguin", 'INSERT INTO users (Username, Password, LoginKey, RegisteredTime, Buddies, Ignores, Inventory) VALUES ("' . $user . '", "' . $pass . '", "' . rand(0, 1000000) . 'i", "0", "[[]]", "[]", "[]")');
- @mysqli_close();
- echo "Successfully created an account! You can now log into it :)";
- #mail($email, "Wizguin Account", "Greetings! You have created an account for Wizguin! Your username is {$user}! Please come on and join the fun!");
- }
- }
- else echo "Failed to register an account, please try again later.";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement