Phpheader ()

Source: Internet
Author: User
Tags php website
Example of phpheader ()
Example 1: In this example, the browser is redirected to the official PHP website.
Header ("Location: http://www.php.net ";);
Exit;
?>
Example 2: to obtain the latest data every time, instead of the data in the Proxy or cache, you can use the following header
Header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT ");
Header ("Last-Modified:". gmdate ("D, d m y h: I: s"). "GMT ");
Header ("Cache-Control: no-cache, must-revalidate ");
Header ("Pragma: no-cache ");
?>
Example 3: make the user's browser unable to find the file information.
Header ("Status: 404 Not Found ");
?>
Example 4: allow users to download files. Header ("Content-type: application/x-gzip ");
Header ("Content-Disposition: attachment; filename = file name ");
Header ("Content-Descr resume ption: PHP3 Generated Data ");
?>

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.