AdBlock Detected

We provide high-quality source code for free. Please consider disabling your AdBlocker to support our work.

Buy me a Coffee

Saved Tutorials

No saved posts yet.

Press Enter to see all results

HTTP Headers in php:trickcode

By pushpam abhishek
Listen to this article

HTTP Headers in PHP

HTTP Headers in php

HTTP Headers in PHP

You can add headers to the HTTP response in PHP using the Header() function. Since the response headers are sent before any of the actual response data, you have to send these headers before outputting any data. So, put any such header calls at the top of your script.

Redirection

<?php
    header('Location: http://www.php.net');
?>

Setting a Last-Modified Header



<?php
 header('Last-Modified: '.gmdate('D, d M Y H:i:s',getlastmod()).' GMT');
?>

Avoid all Caching

<?php
 header('Cache-Control: no-cache, must-revalidate');
 header('Pragma: no-cache');
 header('Expires: Mon,13 Jal 1980 05:00:00 GMT');
?>
Do you know:-

                                        If you like the tutorial, then please share this tutorial with your friends on social media.

                                        Share this post

                                        pushpam abhishek

                                        About pushpam abhishek

                                        Pushpam Abhishek is a Software & web developer and designer who specializes in back-end as well as front-end development. If you'd like to connect with him, follow him on Twitter as @pushpambhshk

                                        2 comments:

                                        1. Peace, mercy and blessings of God be upon you.
                                          Do you need long-term or short-term loans at a relatively low interest rate? We provide financial loans to individuals and companies. Available now: personal loans, commercial loans. This is an opportunity for ...More:Email:stiwartbenard83348@gmail.com

                                          ReplyDelete
                                        2. and many more at 2% interest rate; Contact us via email: whatspp Email: stiwartbenard83348@gmail.com
                                          Mr. Stiwart Benard

                                          ReplyDelete