PHP function header () query a single part of the specific method of parsing _php tutorial

Source: Internet
Author: User
How do we use the specific content we are explaining to you today?Here is a script called calling.php:

 
 
  1. "-//W3C//DTD HTML 4.0 transitional//en"
  2. "Http://www.w3.org/TR/html4/loose.dtd" >
  3. < HTML >
  4. < Head >
  5. < title > Calling page Example title>
  6. Head >
  7. < Body >
  8. < a href="action.php">clickhere! a>
  9. Body >
  10. HTML >

When the user clicks on the connection above, the PHP function header () goes to call action.php. Here is the source code for action.php:

 
  
  
  1. Php
  2. Database Features
  3. redirect
  4. Header ("Location: $HTTP _referer");
  5. Exit
  6. ?>

Here are two common mistakes to remind:

Call the PHP function header () to include an exit statement to stop the script, or the subsequent script may be output before the header is sent.

A common error with the header () function is:

Warning:cannot Add header information-headers already sent ...

The PHP function header () can only be called before the HTML output, so you need to check for empty lines, spaces, and so on that may exist before PHP.


http://www.bkjia.com/PHPjc/446369.html www.bkjia.com true http://www.bkjia.com/PHPjc/446369.html techarticle How to use the specific content we are explaining to you today is a script called calling.php:! Doctypehtmlpublic "-//w3c//dtdhtml4.0transitional//en" "http://www.w3.org/...

  • Related Article

    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.