PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi guys, I'm new to php and programming in general and would really appreciate some help with the elseif statement. The snippet of code below works just fine without elseif, but when I add <?elseif($confirmed=='2'){?> it errors.
onion2k wrote:For future reference, saying "it errors" is no help whatsoever. If you want help with an error tell people what the error message says.
I second that, you are more likely to get help if you paste the error message as this will contain a line number (this might not match the line numbers here, so make it clear which line it actually is.)
A good way to understand errors and fix invalid programming is often to look for the keyword "unexpected" in the parsing errors. Although it will not give you the exact line, it usually is because you forgot a } or a ; at the end of a statement or block.
"Unexpected {keyword}" simply tells you that before that exact portion of code around that line, you have forgotten something or you really placed that keyword incorrectly!