Synopsis:
$_SERVER is an array containing information such as headers, paths, and script locations.
REMOTE_ADDR -- The IP address from which the user is viewing the current page.
getenv -- Gets the value of an environment variable
Output:$_SERVER['REMOTE_ADDR']: 38.107.179.228 getenv('REMOTE_ADDR'): 38.107.179.228 &REMOTE_ADDR: Will not display as registered globals are turned off on http://unix.cms.gre.ac.uk Code:
<?php
echo "$_SERVER['REMOTE_ADDR']: ". $_SERVER['REMOTE_ADDR'] ."<br />";
echo "getenv('REMOTE_ADDR'): ". getenv('REMOTE_ADDR') ."<br />";
echo "&REMOTE_ADDR: ". $REMOTE_ADDR ."<p />";
?>
|
|