Page 1 of 1

Parse Error

Posted: Sat Jul 14, 2007 6:40 pm
by dgny06
Thank you in advance for any help. I started learning PHP about a month ago and had to stop as work was out of control. Now that I am back into it, I am playing around with a page that will write one of two sentences depending on whether or not an access level for the user is "1" or not. When the page runs I get the following error:

Parse error: parse error, unexpected T_VARIABLE in /home/content/m/o/t/motionto/html/SecureSite/home.php on line 15

I know that this is probably a minor syntax error on my part but after an hour of trying to figure it out I figured I would ask for some help. The username and password are pulled from the form that his this page as the action.



<?PHP include("connection/connect.php"); ?>

<?PHP

$UserName = $_POST["UserName"];
$Password = $_POST["Password"];

?>

Your entered a username of <b>"<?PHP echo $UserName; ?>"</b> and password of <b>"<?PHP echo $Password; ?>"</b>.

<?PHP

$FindUser = "select AccessLevel from tbUser where UserName = '$UserName' and Password = '$Password'"
$FoundUser = mysql_query($FindUser) //this is line 15

if ($FoundUser == "1")
echo "This is what you see if you are a valid user.";
else echo "This is what you see if you are an invalid user.";
?>

Posted: Sat Jul 14, 2007 6:43 pm
by dgny06
damn semicolon lol.....so I now realized that I was missing a semicolon but now I get the following error:

Parse error: parse error, unexpected T_IF in /home/content/m/o/t/motionto/html/SecureSite/home.php on line 17

line 17 is if ($FoundUser == "1")

Posted: Sat Jul 14, 2007 6:55 pm
by feyd
You're missing more than one semicolon.

Posted: Sat Jul 14, 2007 6:57 pm
by dgny06
OMG.....I have really been staring at the screen too long....can't believe I missed that one too.

Thanks again I really appreciate your help!!!