PDA

View Full Version : parse error


neal
13 Feb 2002, 01:39
<?php
include('global.php');
if ($bbuserinfo[userid]==0) {
echo "Login!"
}
else {
echo "You're already Logged in!"
}
?>

Why is that getting a parse error?

Parse error: parse error, expecting `','' or `';'' in /home/teenaged/public_html/login.php on line 5

malayneum
13 Feb 2002, 01:49
try this
<?php

include("global.php"); // <-- just my habit to put " not '

if ($bbuserinfo[userid] == 0) {
echo "Login!"; // <-- you forgot ;
}

else {
echo "You\\'re already Logged in!"; // <-- you forgot to escape ' and forgot to add ;
}

?>

please correct me is something goes wrong.

add : my wrong .... slashes strip-off by vB

tbloom2002
13 Feb 2002, 01:50
you need a semicolon after the echo statements... like this:


<?php
include('global.php');
if ($bbuserinfo[userid]==0) {
echo "Login!";
}
else {
echo "You're already Logged in!";
}
?>

neal
13 Feb 2002, 02:13
ahh, thanks to you both

Chen
13 Feb 2002, 06:00
malayneum, you don't need to escape ' when quoting the string with ", and the other way around. :)