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!
Hello all, I'm a PHP noob who's having issues with conditional statements. I ran into a problem in an include that has my navbar. I set up a simple if statement to show a selected class when that page is selected and that's working fine. However I wanted to add another condition to show a subnav and that's where the problem lies (line 13). I know about escaping quotes, but even when considering that I still can't get my code to work entirely. It's doing what I want it to, but the PHP still shows up in the source code which I know is incorrect. I've attached my code. Thanks in advance for your help.
You are echoing the php tags within the "echo". To simplify it, just exit the php tag after the first if statement. Also, notice where I changed single quotes to double and changed the spacing inside the links.
Reviresco,
Thank you very much for your help. My problem is fixed. I appreciate your answer and resisting the urge to make fun of me for not seeing the obvious problem. I have quite a bit to learn still.