Yet another error debug thread...
Posted: Fri Mar 12, 2010 3:12 am
Hello all, let me just say I'm very impressed with the setup here and I find it great that you guys are taking time out to help out beginners like me interested in PHP. We all gotta start somewhere and I'm thankful for the helpful videos and tutorials available on a site like this.
Anyways, I'm extremely confused to why I'm getting this error. This is essentially taken from the source code in the MMO tutorial videos; hallsofvalhalla's register code. I just changed the variables name, database names and a few other to learn about how it works on PHP. Can someone explain to me why I get...
Parse error: parse error in C:\wamp\www\GuyOnline\RegisterUser.php on line 57...
When Line 57 is basically...
Could someone point me in the right direction? I'm eager to learn.
Anyways, I'm extremely confused to why I'm getting this error. This is essentially taken from the source code in the MMO tutorial videos; hallsofvalhalla's register code. I just changed the variables name, database names and a few other to learn about how it works on PHP. Can someone explain to me why I get...
Parse error: parse error in C:\wamp\www\GuyOnline\RegisterUser.php on line 57...
Code: Select all
<?php
include 'RegisterConnect.php';
?>
<?php
$username=$_POST['username'];
$password=$_POST['password'];
$confirm=$_POST['confirm'];
$email=$_POST['email'];
$username=strip_tags($username);
$email=strip_tags($email);
if ($email == "")
{
echo "You didn't enter an email address!<br>";
echo " <br><A href='RegisterPage.php'>Go back.</a><br>";
exit;
}
if ($password==$confirm)
{
$isplayer="SELECT * from playerinfotable where PlayerName='$username'";
$isplayer2=mysql_query($isplayer) or die("Could not query players table.");
$isplayer3=mysql_fetch_array($isplayer2);
if(!$_POST['password'] || !$_POST['confirm'])
{
print "You did not enter a password.";
echo " <br><A href='RegisterPage.php'>Go back.</a><br>";
exit;
}
else if($isplayer3 || strlen($username)>15 || strlen($username)<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 " <br><A href='RegisterPage.php'>Go back.</a><br>";
exit;
}
else
{
$isaddress="SELECT * from playerinfotable where PlayerEmail='$email'";
$isaddress2=mysql_query($isaddress) or die("Could not query for password.");
$isaddress3=mysql_fetch_array($isaddress2);
if($isaddress3)
{
print "There is already a player with that e-mail address.<br>";
echo " <br><A href='RegisterPage.php'>Go back.</a><br>";
exit;
}
else
{
$password=md5($password);
$SQL = "INSERT into playerinfotable(PlayerName, PlayerPassword, PlayerEmail) VALUES ('$username','$password','$email')";
mysql_query($SQL) or die("Could not register.");
print "Thank you for registering.";
}
} //Line 57 =
}
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 "<br><br><A href='login.php'>Login Page</a>";
?>Code: Select all
$SQL = "INSERT into playerinfotable(PlayerName, PlayerPassword, PlayerEmail) VALUES ('$username','$password','$email')";
mysql_query($SQL) or die("Could not register.");
print "Thank you for registering.";
}
} //Line 57 =
}