Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.12 KB | None | 0 0
  1. <?php
  2. //Include connection file
  3. include("global.php");
  4.  
  5. //Check if logged in
  6. if(!isset($islogged))
  7. {
  8.     if(isset($_POST['user']) && isset($_POST['pass']) && isset($_POST['cpass']) && isset($_POST['email']) && isset($_POST['fname']) && isset($_POST['lname']))
  9.     {
  10.         if(isset($_POST['terms']) > 0)
  11.         {
  12.             $user = cleanmysql($_POST['user']);
  13.             $pass = md5("salty" . $_POST['pass'] . "salts");
  14.             $email = cleanmysql($_POST['email']);
  15.             $fname = cleanmysql($_POST['fname']);
  16.             $lname = cleanmysql($_POST['lname']);
  17.             $getemail = cleanmysql($_POST['getemail']);
  18.             $bday = $_POST['day'];
  19.             $bmonth = $_POST['month'];
  20.             $byear = $_POST['year'];
  21.             $btime = strtotime($bday . "-" . $bmonth . "-" . $byear);
  22.            
  23.             $select = @mysql_query("SELECT * FROM `users` WHERE `name` = '" . $user . "' OR `email` = '" . $email . "' LIMIT 1");
  24.             if(mysql_num_rows($select) < 1)
  25.             {
  26.                 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');");
  27.                 echo "You have been registered!";
  28.             }
  29.             else
  30.             {
  31.                 echo "An account already exists with that username or email.";
  32.             }
  33.         }
  34.         else
  35.         {
  36.             echo "You must accept the terms and conditions";
  37.         }
  38.     }
  39.     elseif(isset($_POST['sub']))
  40.     {
  41.         echo "You must fill in all form fields.";
  42.     }
  43.     ?>
  44.         <form method="POST">
  45.             Username:<br /><input type="text" name="user"><br />
  46.             Password:<br /><input type="password" name="pass"><br />
  47.             Confirm password:<br /><input type="password" name="cpass"><br />
  48.             Email:<br /><input type="text" name="email"><br />
  49.             First name:<br /><input type="text" name="fname"><br />
  50.             Last name:<br /><input type="text" name="lname"><br />
  51.             Birthday: <select name="day" class="bigbox_select">
  52.                             <?php
  53.                                 for ($i = 1; $i <= 31; $i++)
  54.                                 {
  55.                                     echo '<option '.$s.' value="'.$i.'">'.$i.'</option>\n';
  56.                                 }
  57.                             ?>
  58.                         </select>
  59.                         <select name="month" class="bigbox_select">
  60.                             <?php
  61.                                 for ($i = 1; $i <= 12; $i++)
  62.                                 {
  63.                                     echo '<option '.$s.' value="'.$i.'">'.$i.'</option>\n';
  64.                                 }
  65.                             ?>
  66.                         </select>
  67.                         <select name="year" class="bigbox_select">
  68.                             <?php
  69.                                 for ($i = 1910; $i <= date('Y'); $i++)
  70.                                 {
  71.                                     $s = date('Y') == $i ? 'selected="selected"' : '';
  72.                                     echo '<option '.$s.' value="'.$i.'">'.$i.'</option>\n';
  73.                                 }
  74.                             ?>
  75.                         </select><br />
  76.             Gender: <select name="sex">
  77.                 <option value="male">Male</option>
  78.                 <option value="female">Female</option>
  79.             </select><br />
  80.             <input type="checkbox" name="getemail" value="1">Recieve email from staff<br />
  81.             <input type="checkbox" name="terms" value="1">I accept the terms and conditions<br />
  82.             <br /><input type="submit" name="sub" value="Register">
  83.             <a href="login.php">Login</a>
  84.         </form>
  85.     <?php
  86. }
  87. else
  88. {
  89.     header("Location: index.php");
  90. }
  91.  
  92. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement