|
|
PHP - $_SERVER Information
Useful Information in $_SERVER variable...
PHP does most of the hard work for you. Hidden away in $_SERVER variable is a wealth of information telling you about the person currently requesting information from the page. This information while accurate 99.9% of the time, can be easily 'faked' by someone who knows what they are doing, so be cautious when developing a system around this data.!
//Get the IP address of the person accessing the page... echo $_SERVER['REMOTE_ADDR'];
38.107.191.98
/* The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted. */ echo $_SERVER['HTTP_REFERER']; Notice: Undefined index: HTTP_REFERER in /home/openzu/www/inlinedemos/server_variable.demo.php on line 20
For more information please visit PHP.net
Page Responses
Currently there have been no responses to this page...
If you have anything to contribute to this tutorial, found a bug, or know a better way of achieving the same goal, please leave your response below.
|