code for getting IP and system date and time .
Posted: Sun Feb 21, 2010 6:26 am
in my php page i have added code for getting IP
but i am not getting the real IP . HOW TO GET THE REAL IP ??
give me a solution..
i have got one more problem..
to get the system date and time .added the following
but the time am getting is 3 hours behind the system time , i need to get the system time , how??
suggestions plz...thank u..
Code: Select all
if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
give me a solution..
i have got one more problem..
to get the system date and time .added the following
Code: Select all
$date = date(' d/m/Y h:i:s A');
suggestions plz...thank u..