Several errors in a PHP file(Following tutorial)
Posted: Fri Nov 16, 2012 9:27 pm
Hello there! first of all let me say: THANK YOU to indie-resource... for existing
and to hallsofValhalla for guiding me here 
I am at his "3b" video in making a browser MMORPG, and I get tons of errors when trying to press the Submit button...
Error: Fatal error: Function name must be a string in D:\Programfiler (x86)\wamp\www\tutorial\reguser.php on line 6
Code:


I am at his "3b" video in making a browser MMORPG, and I get tons of errors when trying to press the Submit button...
Error: Fatal error: Function name must be a string in D:\Programfiler (x86)\wamp\www\tutorial\reguser.php on line 6
Code:
Code: Select all
<?php
include 'connect.php';
?>
<?php
$players=$_POST('player');
$password=$_POST('password');
$repassword=$_POST('repassword');
$player=strip_tags($player);
$email=$_POST('email');
$email=strip_tags($email);
if ($email == "")
{
echo "Please enter a email address!<br>";
echo " <A href='register.php'>Go back</a>";
exit;
}
if ($password==$repassword)
{
$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('repassword'))
{
print "Please enter a password<br>";
echo " <A h ref='register.php'>Go back</a>";
exit;
}
else if($isplayer3)
{
print "That username is already in use! Please choose another one.";
echo " <A href='register.php'>Go back</a><br>";
exit;
}
else if(strlen($player)>20 || strlen($player)<3)
{
print "Your username is either too long or too short. It needs to be between 3-20 letters.";
echo " <A href='register.php'>Go back</a><br>";
exit;
}
else
{
$isemail="SELECT * from players where email='$email'";
$isemail2=mysql_query($isemail) or die("Not able to query for email");
$isemail3=mysql_fetch_array($isemail2);
if($isemail3)
{
print "That E-mail address is already in use!";
echo "A href='register.php'>Go back</a><br>";
exit;
}
else
{
$password=md5($password);
$SQL ="INSERT into players(name, password, email, level, xp) VALUES ('$player','$password','1','1')";
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";
echo " <A href='registter.php'>Go back></a><br>";
exit;
}
echo " <A href='login.php'>Click here to log in!</a><br>";
?>