Debugging Question: unexpected T_ELSE

I’m pretty new to PHP and I was messing around with a prefab login script to use for my website. I came across a syntax error that I can’t make sense of:

Parse error: syntax error, unexpected T_ELSE in [siteurl]/login.php on line 71

Offending code:

64 setcookie(cvc123, $_POST['pass'], $hour); 65 // 66 //redirect 67 header("Location: members.php"); 68 } 69 } 70 } 71 else 72 {

I’ve tried looking around at my semicolons and brackets, but everything checks out. What am I missing?


It could also be something like a missing > or < or quotes. It’s been my experience that the “Missing T_xxxxx” is almost always a missing syntax item.

Well, I am not seeing an if…

If there are ifs above that code, then you make have 1 too many }s or 1 too little }s…

indent your code!!!

Sponsor our Newsletter | Privacy Policy | Terms of Service