rianto isaac's Weblog

rianto utomo isaac sahala utomo

php-mysql, client IP dan computer name, nama komputer

leave a comment »

if ( isset($_SERVER["REMOTE_ADDR"]) )    {
$ip=$_SERVER["REMOTE_ADDR"] . ' ';
} else if ( isset(
$_SERVER["HTTP_X_FORWARDED_FOR"]) )    {
$ip=$_SERVER["HTTP_X_FORWARDED_FOR"] . ' ';
} else if ( isset(
$_SERVER["HTTP_CLIENT_IP"]) )    {
$ip=$_SERVER["HTTP_CLIENT_IP"] . ' ';
}
echo
'Clients IP  Address: ' . $ip;

rianto utomo bole nyontek dari http://www.phpbuilder.com/board/showthread.php?t=10327697

//komputer name
echo gethostbyaddr($_SERVER[‘REMOTE_ADDR’]);
//IP komputer
echo GetHostByName($REMOTE_ADDR);

rianto utomo bole nyontek dari http://lostwithin.net/how-to-get-users-ip-and-computer-name-using-php/

Written by isaaconi

Oktober 5, 2011 pada 9:12 am

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: