...

View Full Version : Grr...if else problem...



Jearb
03-18-2009, 09:31 PM
Alright, I've got this code, but I can't for the life of me figure out what is going wrong. When I run it, it gives me an unexpected '{' error.


if (($_COOKIE["6511102b"]!="newFile") ||
(empty($_SESSION["gender"]) ||
(empty($_SESSION["name"])) {
echo "WHOA WHOA WHOA WHOA. You did something wrong. Or something. Go <a href='newGame.php'>back here</a> to remake your file.</a>";
} else {

It's probably some stupid problem, but can you guys help me out?

steelaz
03-18-2009, 09:46 PM
Brackets are confusing :)



if (($_COOKIE["6511102b"]!="newFile") || (empty($_SESSION["gender"])) || (empty($_SESSION["name"]))) {
echo "WHOA WHOA WHOA WHOA. You did something wrong. Or something. Go <a href='newGame.php'>back here</a> to remake your file.</a>";
} else {

djm0219
03-18-2009, 10:32 PM
You opened a brace on the else but don't appear to have anything after it nor the closing brace.



} else {
print 'do something';
}

steelaz
03-18-2009, 10:39 PM
I assume he left that off intentionally, but he was missing extra closing parenthesis on line 2 and 3, which I fixed in my post above.

Jearb
03-18-2009, 10:55 PM
Thanks - now it works. :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum