Can someone explain to me why this works?
<?php if ($selected_subject_id) { ?>
<h2>Manage Subject</h2>
<?php } elseif ($selected_page_id) { ?>
<h2>Manage Page</h2>
<?php } else { ?>
Please select a subject or a page.
<?php }?>
Basically, if you click a subject "Manage Subject" displays as title if you click a page "Manage Page" displays as title if neither are clicked it displays "Please select a subject or page" ONLY ONE OF THESE ARE DISPLAYED AT A TIME
My question is, why do the titles/msg behave as if they were inside the PHP script (obeying the conditionals) when they are actually outside of it?
Is it because they're "within" the opening and closing braces of the conditional?
In what other situations will this work?
Thanks.