Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 7.40 KB | None | 0 0
  1. <?php
  2. include("top.php");
  3. include("config2.php"); ?>
  4.  
  5. <div id="content">
  6.             <div id="news-content">
  7.                 <h3><img src="dark_images/registration.png" alt="Register"></h3>
  8.                 <div class="post">
  9.                 <div class="post-content">
  10.                         <p>
  11.         </p><center>
  12.         <table width="90%">
  13.             <tbody><tr width="100%">
  14.                 <td width="100%">
  15.                     <div align="left"><center>
  16.    
  17.   <script language=JavaScript>
  18. var message="Can't do this here.";
  19. function clickIE() {if (document.all) {(message);return false;}}
  20. function clickNS(e) {if
  21. (document.layers||(document.getElementById&&!document.all)) {
  22. if (e.which==2||e.which==3) {(message);return false;}}}
  23. if (document.layers)
  24. {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
  25. else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
  26.  
  27. document.oncontextmenu=new Function("return false")
  28.  
  29. </script>
  30. <?php
  31. if($_SESSION['id']){
  32.     echo "<legend><b>Error!</b></legend><br />";
  33.     echo "You are already logged in, therefore you can not register a new account!";
  34. }else{
  35.     if(!$_POST['register']){
  36.         echo "Fill out all of these fields below in order to create a new account. This account will be used to enter TranceMS, so you are advised not to share the informations with anyone at all!<br /><br />";
  37.         echo "<form method=\"POST\">";
  38.         echo "<center><table border=\"0\" width=\"300\">";
  39.         echo "<tr><td align=\"left\" width=\"50%\"><b>Username</b></td><td><input type=\"text\" name=\"username\" maxlength=\"12\"></td></tr>";
  40.         echo "<tr><td align=\"left\" width=\"50%\"><b>Password</b></td><td><input type=\"password\" name=\"password\" maxlength=\"12\"></td></tr>";
  41.         echo "<tr><td align=\"left\" width=\"50%\"><b>Confirm Password</b></td><td><input type=\"password\" name=\"cpassword\" maxlength=\"12\"></td></tr>";
  42.         echo "<tr><td align=\"left\" width=\"50%\"><b>Birthday</b><br /><i>(YYYY-MM-DD)</i></td><td valign=\"top\"><input type=\"text\" maxlength=\"10\" name=\"birth\"></td></tr>";
  43.         echo "<tr><td></td><td><br><input type=\"submit\" value=\"Register\" name=\"register\" class=\"button3\" >";
  44.         echo "</table></center></form>";
  45.     }else{
  46.         $username = mysql_real_escape_string($_POST['username']);
  47.         $password = mysql_real_escape_string($_POST['password']);
  48.         $cpassword = mysql_real_escape_string($_POST['cpassword']);
  49.         $birth = mysql_real_escape_string($_POST['birth']);
  50.        
  51.         $ucheck = mysql_query("SELECT * FROM `accounts` WHERE `name`='".$username."'") or die(mysql_error());
  52.         if($username == ""){
  53.             echo "Please supply an username!";
  54.         }elseif(mysql_num_rows($ucheck) >= 1){
  55.             echo "The username already exists. Please select another one!";
  56.         }elseif($password == ""){
  57.             echo "Please supply a password!";
  58.         }elseif($password != $cpassword){
  59.             echo "The passwords don't match!";
  60.         }elseif(strlen($username) < 4){
  61.             echo "Username must be between 4 and 12 characters!";
  62.         }elseif(strlen($username) > 12){
  63.             echo "Username must be between 4 and 12 characters!";
  64.         }elseif(strlen($password) < 6){
  65.             echo "Password must be between 6 and 12 characters!";
  66.         }elseif(strlen($password) > 12){
  67.             echo "Password must be between 6 and 12 characters!";
  68.         }elseif($birth == ""){
  69.             echo "Please supply a birth date!";
  70.         }else{
  71.             $ia = mysql_query("INSERT INTO `accounts` (`name`,`password`,`birthday`) VALUES ('".$username."','".sha1($password)."','".$birth."') or die(mysql_error());
  72.             echo "The user has been succesfully added into the database! You can now play the game!<br /><br />";
  73.             echo "Thank you for registering to TrancemS!<br />";
  74.             echo "- Will";
  75.         }
  76.     }
  77. }
  78.  
  79. ?>
  80. </center>
  81.                    
  82.                     </div>
  83.                 </td>
  84.             </tr>
  85.         </tbody></table>
  86.         <br>
  87.         <br>
  88.         </center>
  89.            
  90.                        
  91.                     </div>
  92.                 </div>
  93. <?php
  94. include("footer.php"); ?>
  95.  
  96.  
  97. <?php
  98. include("top.php");
  99. include("config2.php"); ?>
  100.  
  101. <div id="content">
  102.             <div id="news-content">
  103.                 <h3><img src="dark_images/registration.png" alt="Register"></h3>
  104.                 <div class="post">
  105.                 <div class="post-content">
  106.                         <p>
  107.         </p><center>
  108.         <table width="90%">
  109.             <tbody><tr width="100%">
  110.                 <td width="100%">
  111.                     <div align="left"><center>
  112.    
  113.  <script language=JavaScript>
  114. var message="Can't do this here.";
  115. function clickIE() {if (document.all) {(message);return false;}}
  116. function clickNS(e) {if
  117. (document.layers||(document.getElementById&&!document.all)) {
  118. if (e.which==2||e.which==3) {(message);return false;}}}
  119. if (document.layers)
  120. {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
  121. else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
  122.  
  123. document.oncontextmenu=new Function("return false")
  124.  
  125. </script>
  126. <?php
  127. if($_SESSION['id']){
  128.     echo "<legend><b>Error!</b></legend><br />";
  129.     echo "You are already logged in, therefore you can not register a new account!";
  130. }else{
  131.     if(!$_POST['register']){
  132.         echo "Fill out all of these fields below in order to create a new account. This account will be used to enter TranceMS, so you are advised not to share the informations with anyone at all!<br /><br />";
  133.         echo "<form method=\"POST\">";
  134.         echo "<center><table border=\"0\" width=\"300\">";
  135.         echo "<tr><td align=\"left\" width=\"50%\"><b>Username</b></td><td><input type=\"text\" name=\"username\" maxlength=\"12\"></td></tr>";
  136.         echo "<tr><td align=\"left\" width=\"50%\"><b>Password</b></td><td><input type=\"password\" name=\"password\" maxlength=\"12\"></td></tr>";
  137.         echo "<tr><td align=\"left\" width=\"50%\"><b>Confirm Password</b></td><td><input type=\"password\" name=\"cpassword\" maxlength=\"12\"></td></tr>";
  138.         echo "<tr><td align=\"left\" width=\"50%\"><b>Birthday</b><br /><i>(YYYY-MM-DD)</i></td><td valign=\"top\"><input type=\"text\" maxlength=\"10\" name=\"birth\"></td></tr>";
  139.         echo "<tr><td></td><td><br><input type=\"submit\" value=\"Register\" name=\"register\" class=\"button3\" >";
  140.         echo "</table></center></form>";
  141.     }else{
  142.         $username = mysql_real_escape_string($_POST['username']);
  143.         $password = mysql_real_escape_string($_POST['password']);
  144.         $cpassword = mysql_real_escape_string($_POST['cpassword']);
  145.         $birth = mysql_real_escape_string($_POST['birth']);
  146.        
  147.         $ucheck = mysql_query("SELECT * FROM `accounts` WHERE `name`='".$username."'") or die(mysql_error());
  148.         if($username == ""){
  149.             echo "Please supply an username!";
  150.         }elseif(mysql_num_rows($ucheck) >= 1){
  151.             echo "The username already exists. Please select another one!";
  152.         }elseif($password == ""){
  153.             echo "Please supply a password!";
  154.         }elseif($password != $cpassword){
  155.             echo "The passwords don't match!";
  156.         }elseif(strlen($username) < 4){
  157.             echo "Username must be between 4 and 12 characters!";
  158.         }elseif(strlen($username) > 12){
  159.             echo "Username must be between 4 and 12 characters!";
  160.         }elseif(strlen($password) < 6){
  161.             echo "Password must be between 6 and 12 characters!";
  162.         }elseif(strlen($password) > 12){
  163.             echo "Password must be between 6 and 12 characters!";
  164.         }elseif($birth == ""){
  165.             echo "Please supply a birth date!";
  166.         }else{
  167.             $ia = mysql_query("INSERT INTO `accounts` (`name`,`password`,`birthday`) VALUES ('".$username."','".sha1($password)."','".$birth."') or die(mysql_error());
  168.             echo "The user has been succesfully added into the database! You can now play the game!<br /><br />";
  169.             echo "Thank you for registering to TrancemS!<br />";
  170.             echo "- Will";
  171.         }
  172.     }
  173. }
  174.  
  175. ?>
  176. </center>
  177.                    
  178.                     </div>
  179.                 </td>
  180.             </tr>
  181.         </tbody></table>
  182.         <br>
  183.         <br>
  184.         </center>
  185.            
  186.                        
  187.                     </div>
  188.                 </div>
  189. <?php
  190. include("footer.php"); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement