|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Weird error with else statement
My page is giving me a pase error on line 260. That is where my else statement starts. I have if/else statements in the rest of my scripts and pages and they have no problem what so ever. If I remove the else statement completely and leave just the "if statement" it works fine. Unfortunetly I need the "else statement" because the "if statement" is checking to see whether or not the person is logged in.
I have attached the code
__________________
CHornJr "One day I'll know what I am doing" ![]() My Blog Suanhacky Lodge #49 Rebel Squadrons |
|
#2
|
||||
|
||||
|
See if pulling the semi-colon off
PHP Code:
on line 4 fixes this for you. My guess is that the if is evaluating as a true statement, the opening and closing brace for the if aren't really doing anything but aren't bombing because they're matched up, and the else is being processed as an if-less else. |
|
#3
|
||||
|
||||
|
Thank You. I can't believe I put that semi-colon there and neve noticed it when I was debugging my code
|
|
#4
|
||||
|
||||
|
Nah, that kind of thing's easy to miss because it's precisely the kind of thing you'd never suspect yourself of doing. Plus semi-colons can be hard to see.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Weird error with else statement |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|