Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("top.php");
- include("config2.php"); ?>
- <div id="content">
- <div id="news-content">
- <h3><img src="dark_images/registration.png" alt="Register"></h3>
- <div class="post">
- <div class="post-content">
- <p>
- </p><center>
- <table width="90%">
- <tbody><tr width="100%">
- <td width="100%">
- <div align="left"><center>
- <script language=JavaScript>
- var message="Can't do this here.";
- function clickIE() {if (document.all) {(message);return false;}}
- function clickNS(e) {if
- (document.layers||(document.getElementById&&!document.all)) {
- if (e.which==2||e.which==3) {(message);return false;}}}
- if (document.layers)
- {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
- else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
- document.oncontextmenu=new Function("return false")
- </script>
- <?php
- if($_SESSION['id']){
- echo "<legend><b>Error!</b></legend><br />";
- echo "You are already logged in, therefore you can not register a new account!";
- }else{
- if(!$_POST['register']){
- 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 />";
- echo "<form method=\"POST\">";
- echo "<center><table border=\"0\" width=\"300\">";
- echo "<tr><td align=\"left\" width=\"50%\"><b>Username</b></td><td><input type=\"text\" name=\"username\" maxlength=\"12\"></td></tr>";
- echo "<tr><td align=\"left\" width=\"50%\"><b>Password</b></td><td><input type=\"password\" name=\"password\" maxlength=\"12\"></td></tr>";
- echo "<tr><td align=\"left\" width=\"50%\"><b>Confirm Password</b></td><td><input type=\"password\" name=\"cpassword\" maxlength=\"12\"></td></tr>";
- 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>";
- echo "<tr><td></td><td><br><input type=\"submit\" value=\"Register\" name=\"register\" class=\"button3\" >";
- echo "</table></center></form>";
- }else{
- $username = mysql_real_escape_string($_POST['username']);
- $password = mysql_real_escape_string($_POST['password']);
- $cpassword = mysql_real_escape_string($_POST['cpassword']);
- $birth = mysql_real_escape_string($_POST['birth']);
- $ucheck = mysql_query("SELECT * FROM `accounts` WHERE `name`='".$username."'") or die(mysql_error());
- if($username == ""){
- echo "Please supply an username!";
- }elseif(mysql_num_rows($ucheck) >= 1){
- echo "The username already exists. Please select another one!";
- }elseif($password == ""){
- echo "Please supply a password!";
- }elseif($password != $cpassword){
- echo "The passwords don't match!";
- }elseif(strlen($username) < 4){
- echo "Username must be between 4 and 12 characters!";
- }elseif(strlen($username) > 12){
- echo "Username must be between 4 and 12 characters!";
- }elseif(strlen($password) < 6){
- echo "Password must be between 6 and 12 characters!";
- }elseif(strlen($password) > 12){
- echo "Password must be between 6 and 12 characters!";
- }elseif($birth == ""){
- echo "Please supply a birth date!";
- }else{
- $ia = mysql_query("INSERT INTO `accounts` (`name`,`password`,`birthday`) VALUES ('".$username."','".sha1($password)."','".$birth."') or die(mysql_error());
- echo "The user has been succesfully added into the database! You can now play the game!<br /><br />";
- echo "Thank you for registering to TrancemS!<br />";
- echo "- Will";
- }
- }
- }
- ?>
- </center>
- </div>
- </td>
- </tr>
- </tbody></table>
- <br>
- <br>
- </center>
- </div>
- </div>
- <?php
- include("footer.php"); ?>
- <?php
- include("top.php");
- include("config2.php"); ?>
- <div id="content">
- <div id="news-content">
- <h3><img src="dark_images/registration.png" alt="Register"></h3>
- <div class="post">
- <div class="post-content">
- <p>
- </p><center>
- <table width="90%">
- <tbody><tr width="100%">
- <td width="100%">
- <div align="left"><center>
- <script language=JavaScript>
- var message="Can't do this here.";
- function clickIE() {if (document.all) {(message);return false;}}
- function clickNS(e) {if
- (document.layers||(document.getElementById&&!document.all)) {
- if (e.which==2||e.which==3) {(message);return false;}}}
- if (document.layers)
- {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
- else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
- document.oncontextmenu=new Function("return false")
- </script>
- <?php
- if($_SESSION['id']){
- echo "<legend><b>Error!</b></legend><br />";
- echo "You are already logged in, therefore you can not register a new account!";
- }else{
- if(!$_POST['register']){
- 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 />";
- echo "<form method=\"POST\">";
- echo "<center><table border=\"0\" width=\"300\">";
- echo "<tr><td align=\"left\" width=\"50%\"><b>Username</b></td><td><input type=\"text\" name=\"username\" maxlength=\"12\"></td></tr>";
- echo "<tr><td align=\"left\" width=\"50%\"><b>Password</b></td><td><input type=\"password\" name=\"password\" maxlength=\"12\"></td></tr>";
- echo "<tr><td align=\"left\" width=\"50%\"><b>Confirm Password</b></td><td><input type=\"password\" name=\"cpassword\" maxlength=\"12\"></td></tr>";
- 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>";
- echo "<tr><td></td><td><br><input type=\"submit\" value=\"Register\" name=\"register\" class=\"button3\" >";
- echo "</table></center></form>";
- }else{
- $username = mysql_real_escape_string($_POST['username']);
- $password = mysql_real_escape_string($_POST['password']);
- $cpassword = mysql_real_escape_string($_POST['cpassword']);
- $birth = mysql_real_escape_string($_POST['birth']);
- $ucheck = mysql_query("SELECT * FROM `accounts` WHERE `name`='".$username."'") or die(mysql_error());
- if($username == ""){
- echo "Please supply an username!";
- }elseif(mysql_num_rows($ucheck) >= 1){
- echo "The username already exists. Please select another one!";
- }elseif($password == ""){
- echo "Please supply a password!";
- }elseif($password != $cpassword){
- echo "The passwords don't match!";
- }elseif(strlen($username) < 4){
- echo "Username must be between 4 and 12 characters!";
- }elseif(strlen($username) > 12){
- echo "Username must be between 4 and 12 characters!";
- }elseif(strlen($password) < 6){
- echo "Password must be between 6 and 12 characters!";
- }elseif(strlen($password) > 12){
- echo "Password must be between 6 and 12 characters!";
- }elseif($birth == ""){
- echo "Please supply a birth date!";
- }else{
- $ia = mysql_query("INSERT INTO `accounts` (`name`,`password`,`birthday`) VALUES ('".$username."','".sha1($password)."','".$birth."') or die(mysql_error());
- echo "The user has been succesfully added into the database! You can now play the game!<br /><br />";
- echo "Thank you for registering to TrancemS!<br />";
- echo "- Will";
- }
- }
- }
- ?>
- </center>
- </div>
- </td>
- </tr>
- </tbody></table>
- <br>
- <br>
- </center>
- </div>
- </div>
- <?php
- include("footer.php"); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement