Ok, I'll admit I am fairly new to PhP programming. I have been writing a little game program for my web site, but I have a small problem. There are several places in my code where I test different inputs and if the condition is right, I want to exit the PhP code. The thing is, AFTER the end of my PhP code, I have some Java script that defines my drop-down menus. Like this:
<?
PhP Code
...
...
...
?>
Java Script Starts Here....
When I do an exit; command upon a condition being met, it exits fine except that it completely stops processing any HTML or Java below the ?> (end of PhP code). I thought about trying some sort of Goto, but I understand that is considered bad form. So, give a structure as follows:
<?
Code
.
.
.
if(condition)
{
echo "a message";
exit; // (but I want to execute the Jave at the end)
}
More Code
.
.
.
if (another condition)
{
echo "A different message";
exit; // (but continue to execute Java script at end of this file
}
More Code
.
.
.
.
.
?>
STARTE JAVA CODE
...
...
Ok, so in those "if" statements, how do I branch past the ?> and continue to process my Java menus? Using exit; seems to exit everything and the menus don't show up.
Any help would be appreciated.
Cy