Page 3 of 8

Re: Video#3

Posted: Sat Dec 12, 2009 5:15 am
by hallsofvallhalla
post your register, you are the first to have this error, though I would recommend going on to the later videos

Re: Video#3

Posted: Sat Dec 12, 2009 3:20 pm
by phq
Nvm, i will watch the videos again :)

Re: Video#3

Posted: Fri Jan 01, 2010 11:43 pm
by zolacat999
I also have this problem here is my register.php

<?php
include 'connect.php';

?>

<form methord ="post" action="reguser.php">
type username here: <input type="text" name="player" size="21"><br>
Type password here: <input type="text" name="password" size "15"><br>
retype password again: <input type="text" name="pass2" size "15"><br>
Type email address: <input type="text" name="email" size "60"<br>

<input type="submit" value="submit">

Re: Video#3

Posted: Fri Jan 01, 2010 11:45 pm
by OldRod
methord
Method is spelled wrong?

Re: Video#3

Posted: Sat Jan 02, 2010 7:53 am
by zolacat999
omg i can't believe it, thats fixed it. thanks

Re: Video#3

Posted: Mon Feb 01, 2010 5:40 pm
by Chriillzz
I have a problem when I try to register. This information always comes when I press "submit". "Could not query players table". Could someone help me with this?

Re: Video#3

Posted: Mon Feb 01, 2010 6:06 pm
by OldRod
Post your code and we'll take a look :)

Re: Video#3

Posted: Mon Feb 01, 2010 6:40 pm
by Chriillzz
<?php
include 'connect.php';
?>

<?php
$player=$_POST['player'];
$password=$_POST['password'];
$pass2=$_POST['pass2'];
$player=strip_tags($player);
$email=$_POST['email'];
$email=strip_tags($email);

if ($email == "")
{
echo "You didn't enter a email address!<br>";
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><br>";
exit;
}
else if($isplayer3 || strlen($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<br>";
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 password");
$isaddress3=mysql_fetch_array($isaddress2);
if($isaddress3)
{
print "There is already a player with that e-mail address<br>";
echo " <A href='register.php'>Go back</a>";
exit;
}
else
{
$password=md5($password);

$SQL = "INSERT into players(name, password, email, level, exper) VALUES ('$player','$password','$email','1','0')";
mysql_query($SQL) or die("could not register");

print "Thank you for registering.";

}
}
}

else
{
print "Your password didn't match or you did not enter a password<br>";
echo " <A href='register.php'>Go back</a>";
exit;
}
echo " <A href='login.php'>Login Page</a>";
?>

Re: Video#3

Posted: Mon Feb 01, 2010 6:53 pm
by OldRod
Well... I don't see anything obvious in the code that could cause the problem.

Check to make sure you actually have a 'players' table and it contains a 'name' field.

If you're using WAMP, go into PHPMyAdmin and export the player's table structure, or take a screenshot of the table structure, and post it here too please

Re: Video#3

Posted: Mon Feb 01, 2010 6:57 pm
by Chriillzz
[img]webbrowser.png[/img]