Browser MMO Video #3

Location of the Videos
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#3

Post by hallsofvallhalla »

post your register, you are the first to have this error, though I would recommend going on to the later videos
phq
Posts: 14
Joined: Fri Dec 11, 2009 7:24 am

Re: Video#3

Post by phq »

Nvm, i will watch the videos again :)
zolacat999
Posts: 62
Joined: Tue Nov 24, 2009 11:09 pm

Re: Video#3

Post 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">
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Video#3

Post by OldRod »

methord
Method is spelled wrong?
zolacat999
Posts: 62
Joined: Tue Nov 24, 2009 11:09 pm

Re: Video#3

Post by zolacat999 »

omg i can't believe it, thats fixed it. thanks
Chriillzz
Posts: 7
Joined: Mon Feb 01, 2010 3:29 pm

Re: Video#3

Post 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?
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Video#3

Post by OldRod »

Post your code and we'll take a look :)
Chriillzz
Posts: 7
Joined: Mon Feb 01, 2010 3:29 pm

Re: Video#3

Post 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>";
?>
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Video#3

Post 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
Chriillzz
Posts: 7
Joined: Mon Feb 01, 2010 3:29 pm

Re: Video#3

Post by Chriillzz »

[img]webbrowser.png[/img]
Post Reply

Return to “Older Browser MMO Videos”