问题描述:

I've made a forum and everything went fine until now. Something seems to be wrong with this code even though I have not changed it at all. Even though LOCKED = yes it still goes on and at last it goes to the ELSE instead of stopping at the first IF. Why is this happening and how can I fix this? Thank you!

Code:

if($row['locked']=='yes'){

$status = '<img src="images/forum_closed.png" border="0" style="margin-right: 8px;" title="Closed" />';

}else if($oldthread=='no'){

$status = '<img src="images/forum_newposts.png" border="0" style="margin-right: 8px;" title="New posts" />';

}else{

$status = '<img src="images/forum_nonewposts.png" border="0" style="margin-right: 8px;" title="No new posts" />';

}

When I changed it to 'yes'=='yes' it also passed all the IF and went to the ELSE...


--------------------------------ANSWER------------------------------------------

Now when I finally checked the images it looks like they have somehow swapped names with eachother therefore I thought it had passed the first IF, but it was just the image that was replaced with the incorrect one.

相关阅读:
Top