PHP end script, but does not affect the HTML output. For example: & lt ;? Phpif (! Isset ($ _ GET ["id"]) |! Isset ($ _ GET ["code"]) {echo & nbsp; "& lt; title & gt; Registration Verification & lt; /ti PHP end script but does not affect subsequent HTML output
It may be a small problem.
For example:
If (! Isset ($ _ GET ["id"]) |! Isset ($ _ GET ["code"])
{
Echo"Registration Verification";
Exit ();
}
Else
{
Echo"Registration Verification 1";
}
......
?>
For example, this script is in HTML. To determine whether there is data submitted by GET to output different titles.
There are scripts later, but if GET has no data, it is unnecessary to connect to the database later, so we want to end it.
But after the end, use exit or return, followed by HTMLAnd so on. what should I do?
------ Solution --------------------
Cannot exit ();
Instead, we should put the database connection in the else branch.
------ Solution --------------------
You can also include the php code in a separate file.
Just change exit (); to return;
------ Solution --------------------
This post was last edited by xuzuning at 12:57:32 and you can also write functions.
Structured programming is nothing more
If else
If elseif else
Switch case default
The alternative is
While break
I really don't like structured programming
Php5.3 has recovered support for goto, and the proper use is quite good.
Goto;
Echo 123; // not executed here
A:
Echo 'ABCD ';