2 Steps to use http referer in php



Step 2: How to get information in http referer

If you are using php, you can use $_SERVER to get its information.

For example, you can run code below in a php file.


<?php

print_r($_SERVER);

?>

If you open you test php page from other url, you will find a result like:


[HTTP_REFERER] => http://127.0.0.1/test.php

Then you will get information stored up in http referer.

Tips and Warnings:

(1)If your print $_SERVER in test.php and you open it in your browser address url directly, you will not find a item like:[HTTP_REFERER], because http referer has not stored up anyinformation, then you can not find it.

Category: PHP Programming

TAG:

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>