PHP

HTTP Headers in php:trickcode

HTTP Headers in php,Avoid all Caching,Redirection,Setting a Last-Modified Header
Share it:

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 it:

                                        PHP

                                        Post A Comment:

                                        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