How to deal with the new person's header

Source: Internet
Author: User
New to the header
This post was last edited by Kerrylovelj on 2015-01-24 11:37:09

Recently in the study, encountered the form of repeating the problem of submission. Later Baidu search to use the header ("Location: $post");
My form is presented to this page, this page gets the $_post value to form the SQL statement, and the last function executes the SQL statement.
$sql = "...";//Compose SQL statement 1
Exeupdate ($sql);//write your own execution function 2
Header ("Location: $post");//Jump 3

Originally I thought the normal execution order is the one-time and then converted back to this page, because this page through the session value can obtain the data, therefore can see the immediate data update situation.

But after I put 2 3 upside down, the data can still be updated. What is this for?



------to solve the idea----------------------
After the header, he would still execute the following code, not explaining your question.

Take a EXIT.
------to solve the idea----------------------
The header simply sends an HTTP protocol header
Does not interrupt the execution of the current program
------to solve the idea----------------------
Like upstairs said the header just sends an HTTP protocol header
Before jumping, he will also go down, general jump and exit (); Use with

  • 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.