daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Jun 5th, 2017 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?
  2. if (!isset($_POST['RegSend'])) {
  3. ?>
  4. <h1>User Register</h1><Br />
  5. <form method="post">
  6.     <table class="Register">
  7.         <tr>
  8.             <td>
  9.             Username:
  10.             </td>
  11.             <td>
  12. <input type="text" class="Reg" name="RegUser" onkeypress="return alpha(event,numbers+letters)" value="<?echo $RegUser;?>" />
  13.             </td>
  14.             <td>
  15.                 4-16 chars.
  16.             </td>
  17.         </tr>
  18.         <tr>
  19.             <td>
  20.             Password:
  21.             </td>
  22.             <td>
  23.                 <input type="password" class="Reg" name="RegPass" onkeypress="return alpha(event,numbers+letters)" />
  24.             </td>
  25.             <td>
  26.                 4-16 chars.
  27.             </td>
  28.         </tr>
  29.         <tr>
  30.             <td>
  31.             Re-type Password:
  32.             </td>
  33.             <td>
  34.                 <input type="password" class="Reg" name="RegPass2" onkeypress="return alpha(event,numbers+letters)" />
  35.             </td>
  36.             <td>
  37.                 4-16 chars.
  38.             </td>
  39.         </tr>
  40.         <tr>
  41.             <td>
  42.             E-Mail:
  43.             </td>
  44.             <td>
  45. <input type="text" class="Reg" name="RegEmail" value="<?echo $RegEmail;?>" onkeypress="return alpha(event,numbers+letters+email)" />
  46.             </td>
  47.         </tr>
  48.         <tr>
  49.             <td>
  50.             Re-type E-Mail:
  51.             </td>
  52.             <td>
  53. <input type="text" class="Reg" name="RegEmail2" onkeypress="return alpha(event,numbers+letters+email)" />
  54.             </td>
  55.         </tr>
  56.         <tr>
  57.             <td>
  58.             Steam ID:
  59.             </td>
  60.             <td>
  61. <input type="text" class="Reg" name="RegSid" value="<?echo $RegSid;?>" onkeypress="return alpha(event,numbers+letters+sid)" />
  62.             </td>
  63.             <td>
  64.                 Format: STEAM_X:X:XXXXXXXX
  65.             </td>
  66.         </tr>
  67.         <tr>
  68.             <td>
  69.             </td>
  70.             <td>
  71.                 <input type="submit" class="Reg" name="RegSend" value="Send" />
  72.             </td>
  73.            
  74.         </tr>
  75.     </table>
  76. </form>
  77. <?
  78. }else {
  79.     $RegUser = security($_POST['RegUser']);
  80.     $RegPass = security($_POST['RegPass']);
  81.     $RegPass2 = security($_POST['RegPass2']);
  82.     $RegEmail = security($_POST['RegEmail']);
  83.     $RegEmail2 = security($_POST['RegEmail2']);
  84.     $RegSid = security($_POST['RegSid']);
  85.     $sql = mysql_query("SELECT * FROM `mossad_user` WHERE `player_name` = '$RegUser' ");
  86.     $sql2 = mysql_query("SELECT * FROM `mossad_user` WHERE `player_sid` = '$RegSid' ");
  87.     $sql3 = mysql_query("SELECT * FROM `mossad_user` WHERE `player_email` = '$RegEmail' ") or die(mysql_error());
  88. ?>
  89. <h1>User Register</h1><Br />
  90. <form method="post">
  91.     <table class="Register">
  92.         <tr>
  93.             <td>
  94.             Username:
  95.             </td>
  96.             <td>
  97. <input type="text" class="Reg" name="RegUser" value="<?echo $RegUser;?>" />
  98.             </td>
  99.             <td>
  100.                 4-16 chars.
  101.             </td>
  102.         </tr>
  103. <? if (empty($RegUser)) {
  104.     $error = 1;
  105.     echo "<tr><td></td><td><li>Fill this field!</li></td></tr>";
  106. }else {
  107.     if ( mysql_num_rows($sql) > 0) {
  108.         $error = 1;
  109.         echo "<tr><td></td><td><li>Username is already taken!</li></td></tr>";
  110.     }
  111. }
  112. if ( strlen($RegUser) < 6 && strlen($RegUser) > 16 ) {
  113.     $error = 1;
  114.     echo "<tr><td></td><td><li>Username is too long or too short!</li></td></tr>";
  115. }
  116.  
  117. ?>
  118.         <tr>
  119.             <td>
  120.             Password:
  121.             </td>
  122.             <td>
  123.                 <input type="password" class="Reg" name="RegPass" />
  124.             </td>
  125.             <td>
  126.                 4-16 chars.
  127.             </td>
  128.         </tr>
  129. <? if (empty($RegPass)) {
  130.     $error = 1;
  131.     echo "<tr><td></td><td><li>Fill this field!</li></td></tr>";
  132. }
  133. if ( strlen($RegPass) < 6 && strlen($RegPass) > 16 ) {
  134.     $error = 1;
  135.     echo "<tr><td></td><td><li>Password is too long or too short!</li></td></tr>";
  136. }
  137. if ( $RegPass !== $RegPass2 ) {
  138.     $error = 1;
  139.     echo "<tr><td></td><td><li>Passwords don't match!</li></td></tr>";
  140. }
  141. ?>
  142.         <tr>
  143.             <td>
  144.             Re-type Password:
  145.             </td>
  146.             <td>
  147.                 <input type="password" class="Reg" name="RegPass2" />
  148.             </td>
  149.             <td>
  150.                 4-16 chars.
  151.             </td>
  152.         </tr>
  153. <? if (empty($RegPass2)) {
  154.     $error = 1;
  155.     echo "<tr><td></td><td><li>Fill this field!</li></td></tr>";
  156. }
  157. if ( strlen($RegPass2) < 6 && strlen($RegPass2) > 16 ) {
  158.     $error = 1;
  159.     echo "<tr><td></td><td><li>Password is too long or too short!</li></td></tr>";
  160. }
  161. if ( $RegPass !== $RegPass2 ) {
  162.     $error = 1;
  163.     echo "<tr><td></td><td><li>Password's don't match!</li></td></tr>";
  164. }
  165. ?>
  166.         <tr>
  167.             <td>
  168.             E-Mail:
  169.             </td>
  170.             <td>
  171. <input type="text" class="Reg" name="RegEmail" value="<?echo $RegEmail;?>" />
  172.             </td>
  173.         </tr>
  174. <? if (empty($RegEmail)) {
  175.     $error = 1;
  176.     echo "<tr><td></td><td><li>Fill this field!</li></td></tr>";
  177. }else {
  178.     if ( mysql_num_rows($sql3) > 0 ) {
  179.         $error = 1;
  180.         echo "<tr><td></td><td><li>E-Mail is already taken!</li></td></tr>";
  181.     }
  182. }
  183. if ( $RegEmail !== $RegEmail2 ) {
  184.     $error = 1;
  185.     echo "<tr><td></td><td><li>E-Mail's don't match!</li></td></tr>";
  186. }
  187. ?>
  188.         <tr>
  189.             <td>
  190.             Re-type E-Mail:
  191.             </td>
  192.             <td>
  193. <input type="text" class="Reg" name="RegEmail2" />
  194.             </td>
  195.         </tr>
  196. <? if (empty($RegEmail2)) {
  197.     $error = 1;
  198.     echo "<tr><td></td><td><li>Fill this field!</li></td></tr>";
  199. }
  200. if ( $RegEmail !== $RegEmail2 ) {
  201.     $error = 1;
  202.     echo "<tr><td></td><td><li>E-Mail's don't match!</li></td></tr>";
  203. }
  204. ?>
  205.         <tr>
  206.             <td>
  207.             Steam ID:
  208.             </td>
  209.             <td>
  210. <input type="text" class="Reg" name="RegSid" value="<?echo $RegSid;?>" />
  211.             </td>
  212.             <td>
  213.                 Format: STEAM_X:X:XXXXXXXX
  214.             </td>
  215.         </tr>
  216. <?
  217. if (empty($RegSid)) {
  218.     $error = 1;
  219.     echo "<tr><td></td><td><li>Fill this field!</li></td></tr>";
  220. }else {
  221.     if (!preg_match('^STEAM_[0-1]:[0-1]:(\d+)^', $RegSid) ) {
  222.         $error = 1;
  223.         echo "<tr><td></td><td><li>Steam ID is invalid!</li></td></tr>";
  224.     }
  225. }
  226. if ( mysql_num_rows($sql2) > 0) {
  227.     $error = 1;
  228.     echo "<tr><td></td><td><li>Steam ID is already taken!</li></td></tr>";
  229. }
  230.  
  231. ?>
  232.         <tr>
  233.         </tr>
  234.         <tr>
  235.             <td>
  236.             </td>
  237.             <td>
  238.                 <input type="submit" class="Reg" name="RegSend" value="Send" />
  239.             </td>
  240.         </tr>
  241.         <tr>
  242.             <td>
  243.             </td>
  244.             <td>
  245.                 <?
  246.                 if ($error != 0) {
  247.                     echo "You have been registered successfully!";
  248.                     mysql_query("INSERT INTO `mossad_user` (`player_name`, `player_team`, `player_password`, `player_email`, `player_sid`, `player_class`, `hash`, `active`)
  249.                      VALUES ('$RegUser', 'None', '$RegPass', '$RegEmail', '$RegSid', 'N/A', '$hash', '0') ");
  250.                     $to = $RegEmail;
  251.                     $subject = 'Mossad's TF2 League - Season #$leaguenum - Activation Link';
  252.                     $message = '<p><b>Welcome to Mossad's TF2 League - Season #$leaguenum</b></p>Click <a href="$sysweb/?Page=ActivatePlayerAccount&u=$RegUser&hash=$hash">here</a> to activate your account.';
  253.                     $headers = 'From: $sysemail' . "\r\n" . 'Reply-To: $sysemail' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
  254.                     mail($to, $subject, $message, $headers);
  255.                 }
  256.                 ?>
  257.             </td>
  258.         </tr>
  259.     </table>
  260. </form>
  261. <?
  262. }
  263. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top