anybody know how to code this function?
thanks..
detect pc's IP address using PHP
Moderator: General Moderators
-
thematrixuum
- Forum Newbie
- Posts: 1
- Joined: Sat Jul 21, 2007 4:14 am
this code stores the user's ip into a variable called var_ip
Code: Select all
$var_ip = $_SERVER['REMOTE_ADDR'];It should be noted that $_SERVER['REMOTE_ADDR'] is not always set and will leave ugly NOTICE's on your page in the event that it isn't set (depending on your display_error configuration).
It would be wise to check for the existance of it first.
It would be wise to check for the existance of it first.
Code: Select all
if(!empty($_SERVER['REMOTE_ADDR']))
{
$ip = $_SERVER['REMOTE_ADDR'];
} else
{
//$_SERVER['REMOTE_ADDR'] not set
}Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.