Page 1 of 1

If...else parsing error

Posted: Sun Jan 13, 2008 7:45 pm
by AliHurworth
Hi all,
I'm sure this will seem basic, but...
I get the following error:

Code: Select all

Parse error: parse error, unexpected T_ELSE in e:\domains\h\holtworth.co.uk\user\htdocs\workhome\newworkhome.php on line 29
from this code:

Code: Select all

<div><?php
if(!isset($_COOKIE['Testcookie']));
{
echo "Welcome back";
echo $HTTP_COOKIE_VARS["TestCookie"];
}
else{
echo "Welcome to our site! Please login or register";
}
?></div>
I just can't seem to see why it won't work.
Any ideas?

Re: If...else parsing error

Posted: Sun Jan 13, 2008 7:50 pm
by Weirdan
There's semicolon that should not be there:

Code: Select all

if(!isset($_COOKIE['Testcookie']));// <========= here

Re: If...else parsing error

Posted: Sun Jan 13, 2008 7:51 pm
by jimthunderbird
Yes, it's a syntax error in line 2.

Re: If...else parsing error

Posted: Mon Jan 14, 2008 9:53 am
by Jonah Bron
Yeah. I sometimes to that too, just out of habbit. :lol:

Re: If...else parsing error

Posted: Mon Jan 14, 2008 5:55 pm
by AliHurworth
Yes, of course. Thanx all, esp 4 the prompt reply! Lesson: don't debug at 2am...