PHP end script but does not affect the subsequent HTML output

Source: Internet
Author: User
Tags switch case
PHP end script but does not affect the subsequent HTML output
Maybe it's a little white problem.
Like what:
 
  if (!isset ($_get["id"]) | |! Isset ($_get["code"))
{
echo "Registration verification";
Exit ();
}
Else
{
echo "Registration Verification 1";
}
......
?>


This script, for example, is in its own HTML <title>To determine if there is data for the get commit to output a different title</title>
There's a script behind it, but if get doesn't have data, then it's not necessary to connect to the database, so I want to end it.
But after the end, use Exit or return, in the back HTMLContent and so on will not output, how to do?


------Solution--------------------
Cannot exit ();
Instead, put the connected database or something in the Else branch
------Solution--------------------
You can also put these PHP code in a separate file, include in
Just to put exit (); Change to return;

------Solution--------------------
This post was last edited by xuzuning on 2013-02-21 12:57:32

You can also write a function
As structured programming, nothing is
If Else
If ElseIf else
Switch case Default
The alternative point is
While break

Really don't like structured programming when
php5.3 has resumed support for Goto, and proper use is pretty good.
Goto A;
Echo 123; It won't be executed here.
A:
Echo ' ABCD ';
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.