- Bağlantıyı al
- X
- E-posta
- Diğer Uygulamalar
Basit bir kaç php kodu ile web sitemize giren ziyaretçilerin ip adreslerini kaydederek,
- Ne zaman ?
- Hangi İplerle ?
- Kaç Kişi ?
gibi sorulara cevap bulabiliriz.
<?
$ip = $_SERVER[‘REMOTE_ADDR’];
if ( !file_exists(“ipkayit.txt”)) {
touch(“ipkayit.txt”);
$file = @fopen(“ipkayit.txt”, “+r”);
@fclose($file);
header( ‘refresh: 1; url=/’ );
} else {
$file = @fopen(“ipkayit.txt”, “a”);
$text = “—————————–“. “\r\n” . “Tarih : ” . date(‘d/m/Y – H:i’) . “\r\n” . “IP Adresi :” . “\r\n” . $ip . “\r\n”. “—————————–” . “\r\n”;
@fwrite($file, $text);
@fclose($file);
}
?>
$ip = $_SERVER[‘REMOTE_ADDR’];
if ( !file_exists(“ipkayit.txt”)) {
touch(“ipkayit.txt”);
$file = @fopen(“ipkayit.txt”, “+r”);
@fclose($file);
header( ‘refresh: 1; url=/’ );
} else {
$file = @fopen(“ipkayit.txt”, “a”);
$text = “—————————–“. “\r\n” . “Tarih : ” . date(‘d/m/Y – H:i’) . “\r\n” . “IP Adresi :” . “\r\n” . $ip . “\r\n”. “—————————–” . “\r\n”;
@fwrite($file, $text);
@fclose($file);
}
?>
Tek yapmanız gereken php kodlarını eklediğiniz sayfanın dizinindeki ipkayit.txt dosyasını açıp okumak…
- Bağlantıyı al
- X
- E-posta
- Diğer Uygulamalar
Yorumlar
Yorum Gönder