Piranha wrote:Maybe you should look in a tutorial or the manual to see how if-statements are written instead of guessing and come here to have us fix the code for you.
Have you read about the "Alternative syntax for control structures" in PHP?
Anyway, in the original post you have more IF statements than you have ENDIF statements. Not knowing what logic you want to implement, I'm not sure where you want the missing ENDIFs, or if some of the internal IFs should instead be ELSEIFs. Posting your code here within [ php] . . . [/php ] tags (without the spaces I used here) and indenting your code may help make such things more obvious to us.
PS: As the vast majority of PHP programmers use the standard curly-brace notation for control structures, I'd recommend getting used to using them instead of the if(condition): . . . endif; style, just to make it easier for others to read your code:
if($something = $something_else)
{
// do this
}
elseif($something = $another_thing)
{
// do this instead
}
else
{
// otherwise do this
}