Parse Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dgny06
Forum Commoner
Posts: 25
Joined: Thu Jun 14, 2007 11:35 pm

Parse Error

Post 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.";
?>
dgny06
Forum Commoner
Posts: 25
Joined: Thu Jun 14, 2007 11:35 pm

Post 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")
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You're missing more than one semicolon.
dgny06
Forum Commoner
Posts: 25
Joined: Thu Jun 14, 2007 11:35 pm

Post 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!!!
Post Reply