The following code:
<?php
// Get referrer:
$ref=@$HTTP_REFERER;
echo "<b>Referrer of this page = $ref </b><br>";
// Get IP:
$ip=@$REMOTE_ADDR;
echo "<b>IP Address= $ip</b><br>";
?>
Returns:
Referrer of this page =
IP Address=
Why wouldn't this work? Thanks-
$HTTP_REFERER and $REMOTE_ADDR are not defined because register_globals is turned off.
Use $_SERVER['HTTP_REFERER'] and $_SERVER['REMOTE_ADDR'] instead. Do not turn on register_globals.
Try using:
$_SERVER['HTTP_REFERER']
And
$_SERVER['REMOTE_ADDR']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With