Page 1 of 1

3b error with submitting

Posted: Tue Oct 22, 2013 8:22 pm
by zannza95
when i submit my data it doesn't go in to the table.

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;
}


Re: 3b error with submitting

Posted: Tue Oct 22, 2013 8:59 pm
by zannza95
and i f i dont enter data it doesnt run the print and error statements

Re: 3b error with submitting

Posted: Tue Oct 22, 2013 9:10 pm
by hallsofvallhalla
when you do enter data what error are you getting?

Re: 3b error with submitting

Posted: Tue Oct 22, 2013 9:30 pm
by zannza95
here i like you the site
http://www.christstruebride.com/worldof ... gister.php
im not getting an error is the problem, btw vahalla thanks for making the turoials, im learning alot

Re: 3b error with submitting

Posted: Tue Oct 22, 2013 11:17 pm
by zannza95
anyone have an idea of whats going on?

Re: 3b error with submitting

Posted: Wed Oct 23, 2013 1:30 am
by hallsofvallhalla
if ($email === "")

here is one issue

needs to be ==

Next you are missing some code and copied some twice.

Re: 3b error with submitting

Posted: Wed Oct 23, 2013 7:41 pm
by Epiales
You also have:

Code: Select all

else if ($isplayer3 || stelen($player) > 21 || strlen($player) < 1 )
Shouldn't it be:

Code: Select all

else if ($isplayer3 || strlen($player) > 21 || strlen($player) < 1 )