xRennen.de - Dein online Rennspiel

Benutzeranmeldung

Registrieren

Anzeige

Registrieren

0) { echo errorbox("You can't do more than 1 registration."); } else { if (@$_POST['register']) { $user = security($_POST['username']); $pass = security($_POST['password']); $email = security($_POST['email']); $age = security($_POST['age']); $gender = security($_POST['gender']); $country = security($_POST['country']); $sql = mysql_query("SELECT * FROM users WHERE username='$user'"); if (mysql_num_rows($sql) > 0) { echo errorbox("This username is taken."); } else { if (empty($user)) { echo errorbox("Please enter a username."); } elseif (empty($pass)) { echo errorbox("Please enter a password."); } elseif (!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/", $email)) { echo errorbox("Please enter a valid email address."); } else { $userip = $_SERVER['REMOTE_ADDR']; $insery = mysql_query("INSERT users (username, password, email, country, age, gender, avatar, carid, money, rang, win, losses, power, acceleration, aerodynamics, engine_level, turbo_level, tires_level, suspension_level, userip) VALUES ('$user', '$pass', '$email', '$country', '$age', '$gender', 'img/no-avatar.png', '1', '10000', 'user', '0', '0', '120', '10', '60', '0', '0', '0', '0', '$userip')"); $rowe = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE username='$user'")); $userid = $rowe['id']; $usern = $rowe['username']; $day = date("d"); $insert10 = mysql_query("INSERT rpd (user, races, day) VALUES ('$usern', '0', '$day')"); echo okbox("Your registration is successful."); } } } } ?>