Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Include connection file
- include("global.php");
- //Check if logged in
- if(!isset($islogged))
- {
- if(isset($_POST['user']) && isset($_POST['pass']) && isset($_POST['cpass']) && isset($_POST['email']) && isset($_POST['fname']) && isset($_POST['lname']))
- {
- if(isset($_POST['terms']) > 0)
- {
- $user = cleanmysql($_POST['user']);
- $pass = md5("salty" . $_POST['pass'] . "salts");
- $email = cleanmysql($_POST['email']);
- $fname = cleanmysql($_POST['fname']);
- $lname = cleanmysql($_POST['lname']);
- $getemail = cleanmysql($_POST['getemail']);
- $bday = $_POST['day'];
- $bmonth = $_POST['month'];
- $byear = $_POST['year'];
- $btime = strtotime($bday . "-" . $bmonth . "-" . $byear);
- $select = @mysql_query("SELECT * FROM `users` WHERE `name` = '" . $user . "' OR `email` = '" . $email . "' LIMIT 1");
- if(mysql_num_rows($select) < 1)
- {
- mysql_query("INSERT INTO `users` (`id`, `name`, `firstname`, `surname`, `pass`, `email`, `getemail`, `created`, `rank`, `sso_ticket`, `figure`, `badges`, `dob`, `gender`, `credits`) VALUES (NULL, '" . $user . "', '" . $fname . "', '" . $lname . "', '" . $pass . "', '" . $email . "', '" . $getemail . "', '" . time() . "', '1', '', '1,0,0,0,0', '', '" . $btime . "', '" . $sex . "', '0');");
- echo "You have been registered!";
- }
- else
- {
- echo "An account already exists with that username or email.";
- }
- }
- else
- {
- echo "You must accept the terms and conditions";
- }
- }
- elseif(isset($_POST['sub']))
- {
- echo "You must fill in all form fields.";
- }
- ?>
- <form method="POST">
- Username:<br /><input type="text" name="user"><br />
- Password:<br /><input type="password" name="pass"><br />
- Confirm password:<br /><input type="password" name="cpass"><br />
- Email:<br /><input type="text" name="email"><br />
- First name:<br /><input type="text" name="fname"><br />
- Last name:<br /><input type="text" name="lname"><br />
- Birthday: <select name="day" class="bigbox_select">
- <?php
- for ($i = 1; $i <= 31; $i++)
- {
- echo '<option '.$s.' value="'.$i.'">'.$i.'</option>\n';
- }
- ?>
- </select>
- <select name="month" class="bigbox_select">
- <?php
- for ($i = 1; $i <= 12; $i++)
- {
- echo '<option '.$s.' value="'.$i.'">'.$i.'</option>\n';
- }
- ?>
- </select>
- <select name="year" class="bigbox_select">
- <?php
- for ($i = 1910; $i <= date('Y'); $i++)
- {
- $s = date('Y') == $i ? 'selected="selected"' : '';
- echo '<option '.$s.' value="'.$i.'">'.$i.'</option>\n';
- }
- ?>
- </select><br />
- Gender: <select name="sex">
- <option value="male">Male</option>
- <option value="female">Female</option>
- </select><br />
- <input type="checkbox" name="getemail" value="1">Recieve email from staff<br />
- <input type="checkbox" name="terms" value="1">I accept the terms and conditions<br />
- <br /><input type="submit" name="sub" value="Register">
- <a href="login.php">Login</a>
- </form>
- <?php
- }
- else
- {
- header("Location: index.php");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement