Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- // Config vars
- include("../config/config.php");
- // Variables
- $register = $_POST["Submit"];
- $user = $_POST["Username"];
- $pass = $_POST["Password"];
- $repass = $_POST["RepeatPassword"];
- $email = $_POST["Email"];
- $key = rand(0, 99999999) . "oi";
- $unix = time();
- $inv = "'1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','413'";
- # If the "CREATE PENGUIN" button was pressed
- if(isset($register)) {
- mysql_connect($server, $username, $password);
- if(!$conn) {
- die("Failed to connect to the server: " . mysql_error());
- }
- # Queries for an existing name, to prevent over-write
- $res = mysql_db_query("wizguin", 'SELECT Username FROM users WHERE Username="' . $user . '"');
- # If name exists in SQL
- if(mysql_num_rows($res) != 0) {
- die("That username already exists.");
- }
- # If the password and repeated are the same
- if($pass == $repass) {
- # If the passwords are 4-30
- if(strlen($pass) >= 4 && strlen($pass) <= 30) {
- # If the username is 4-12
- if(strlen($user) >= 4 && strlen($user) <= 12) {
- mysql_db_query("wizguin", "INSERT INTO users (Username, Password, LoginKey, RegisteredTime, Buddies, Ignores, Inventory) VALUES ('{$user}', '{$pass}', '{$key}', '{$unix}', '[]', '[[]]', '[{$inv}]')");
- mysql_close();
- echo '<meta http-equiv="refresh" content="0; url=http://wizguin.byethost3.com/register.html?acc=1" />';
- }
- else echo "Username is too long/short";
- }
- else echo "Passwords are too long/short";
- }
- # If the password and repeated aren't the same
- if($pass != $repass) {
- mysql_close();
- die("Both passwords to not match.");
- }
- }
- mysql_close();
- else echo '<meta http-equiv="refresh" content="0; url=http://wizguin.byethost3.com/register.html" />';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement