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