Code: Select all
<?php
include 'connect.php';
?>
<?php
$player =$_POST['player'];
$password=$_POST['password'];
$pass2=$_POST['pass2'];
$player=strip_tags($player);
$email=$_POST['email'];
$email=stript_tags($email);
if ($email === "")
{
echo "You didin't enter an email address!";
echo " <a href='register.php'> go back </a>";
exit;
}
if ($password==$pass2)
{
$isplayer = "SELECT * from players where name= '$player'";
$isplayer2=mysql_query($isplayer) or die("could not query players table");
$isplayer3= mysql_fetch_array($isplayer2);
if(!$_POST['password'] || !$_POST['pass2'])
{
print "you[did not enter a password";
echo "<a href='register.php' Go back </a>";
exit;
}
else if ($isplayer3 || stelen($player) > 21 || strlen($player) < 1 )
{
print "There is already a player of that name or the name you specified is over 16 letters or less than 1 letter";
echo "<a href='register.php'> Go back</a>";
exit;
}
else
{
$isaddress ="SELECT * from players where email ='$email'";
$isaddress2=mysql_query($isaddress) or die ("not able to query for email");
$isaddress3=mysql_fetch_array($isaddress2);
if ($isaddress3)
{
print "there is already a player with that email address";
echo "<a href='register.php' Go back </a
echo " <a href='register.php'> go back </a>";
exit;
}
if ($password==$pass2)
{
$isplayer = "SELECT * from players where name= '$player'";
$isplayer2=mysql_query($isplayer) or die("could not query players table");
$isplayer3= mysql_fetch_array($isplayer2);
if(!$_POST['password'] || !$_POST['pass2'])
{
print "you did not enter a password";
echo "<a href='register.php' Go back </a>";
exit;
}
else if ($isplayer3 || stelen($player) > 21 || strlen($player) < 1 )
{
print "There is already a player of that name or the name you specified is over 16 letters or less than 1 letter";
echo "<a href='register.php'> Go back</a>";
exit;
}
else
{
$isaddress ="SELECT * from players where email ='$email'";
$isaddress2=mysql_query($isaddress) or die ("not able to query for email");
$isaddress3=mysql_fetch_array($isaddress2);
if ($isaddress3)
{
print "there is already a player with that email address";
echo "<a href='register.php' Go back </a>";
exit;
}
else{
$password=md5($password);
$SQL= "INSERT into players (name, email, level, exper, password) VALUES ('$player','email', '1','0','password'");
mysql_query($SQL) or die ("Could not register");;
print "thank you for registering!";
}
}
else {
print "Your password didn't match or you didnt enter a password";
echo "<a href='register.php' Go back </a>";
exit;
}