Deteksi Pengunjung Web / Blog Anda (PHP Language)

10 07 2009

Bila anda memiliki website ataupun blog, tentunya anda ingin tau, siapa saja yang telah mengunjungi halaman web / blog anda. berikut adalah secuil script dengan bahasa PHP untuk mendeteksi tamu-tamu tersebut.

Source Code:

< ?php
$agent = $_SERVER['HTTP_USER_AGENT'];
$url = $_SERVER['REQUEST_URI'];
$ip = $_SERVER['REMOTE_ADDR'];
$ref = $_SERVER['HTTP_REFERER'];
$proxy = $_SERVER['HTTP_X_FORWARDED_FOR'];
$via = $_SERVER['HTTP_VIA'];
$dtime = date('r');

$entry_line = "Waktu: $dtime |
 IP: $ip |
 Browser: $agent  |
 URL: $url | Referrer: $ref |
 Proxy: $proxy |
 Koneksi: $via |
";

$fp = fopen("visitor.txt", "a");
fputs($fp, $entry_line);
fclose($fp);
?>

Refferensi: http://ilmuwebsite.com/


Actions

Information

One response

31 07 2009

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: