I want to know if there is a function that I can know the IP of a user.
For HTTP_REFERER, I can get the URL from the user such as www.sony.com.
BUT is there any way I can also know the IP of that?
thanks.
I want to know if there is a function that I can know the IP of a user.
For HTTP_REFERER, I can get the URL from the user such as www.sony.com.
BUT is there any way I can also know the IP of that?
thanks.
$_SERVER['REMOTE_ADDR']
thanks, and I am using PHP 3, while I try the following at the very beginning of the page, it does not show anyting, do you know why?
$getIP = $HTTP_SERVER_VARS["REMOTE_ADDR"];
$getREF = $HTTP_SERVER_VARS['HTTP_REFERER'];
$getAGT = $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
echo "IP is ".$getIP."<BR>";
echo "HTTP REF is ".$getREF."<BR>";
echo "USER AGENT is ".$getAGT."<BR>";
Have you tried using a single quote instead of a double quote?
$getIP = $HTTP_SERVER_VARS['REMOTE_ADDR'];
Originally posted by kenny873
thanks, and I am using PHP 3, while I try the following at the very beginning of the page, it does not show anyting, do you know why?
I'm sure you mean, "it shows the variable as NULL ...", IOW, it sez: "IP is" ...
I'd look into the single quote suggestion. I'd also note that the manual suggests that not every webserver knows all these variables, although a great many of them are in the CGI 1.1 spec and should be known values ...