echo("$HTTP_REFERER");
how to convert the above to the IP address
thanks in advance
klyan
preg_match("|http://(.*?)/|", $HTTP_REFERER, $match); echo gethostbyname($match[1]);
What you want is:
$REMOTE_ADDR
For a list of the all env variables and their values, execute the following simple script from the web browser:
<?
phpinfo();
?>
Boris
tststs $REMOTE_ADDR is the client IP, $HTTP_REFER is the place the User came from (via Hyperlink)... not quite the same 🙂
Whoops, I did read that wrong ... Rob. D is right, I made a mistake ... ProgrammerMan's approach will give you what you want. Sorry for the confusion.