Tutorials Infos - Anleitungen - Hilfe - Dreamcodes
 

User Spy

IP, Browser, Uhrzeit und Host werden in einer TXT Datei gespeichert. Das ganze kann man über einen Adminpanel steuern.

Script:

<?php
echo '<div align="center">';
// Dein Passwort
$pw = 'admin';
// ### Loggen ###
// ip.txt öffnen
$file = 'ip.txt';
$fp = fopen($file, 'a');
// Definitionen
$browser = $HTTP_USER_AGENT;
$time = date("d.m.y - H:i:s");
$ip = $_SERVER['REMOTE_ADDR'];
$host = gethostbyaddr($_SERVER['REMOTE_ADDR']);
// In ip.txt schreiben
fputs($fp, "$ip|$time|$browser|$host|");
// ip.txt schließen
fclose($fp);
// ### Admin ###
if($show==$pw) {
$fp = fopen('ip.txt', 'r+');
$ip = fread($fp, filesize('ip.txt'));
$data= explode ("|", $ip);
fclose($fp);
$x = 0; $r = count($data) -1;
echo '<br><a href="ip.php?show=del" title="IPs löschen!">IPs
löschen</a><br><br>
<table border="1" width="700" align="center">
<tr align="center">
<td><b>IP</b></td>
<td><b>Uhrzeit</b></td>
<td><b>Browser</b></td>
<td><b>Host</b></td>
</tr>';
while($x < $r){
echo "<tr>\n<td>$data[$x]</td>\n"; $x ++;
echo "<td>$data[$x]</td>\n"; $x ++;
if (strlen ($data[$x]) > 60) { $data[$x] = substr ($data[$x],0,60) . '...';
}
echo "<td>$data[$x]</td>\n"; $x ++;
echo "<td>$data[$x]</td>\n</tr>\n"; $x ++;
} // while
echo '</table>';
} // if($show=='$pw')
// ### ip.txt leeren ###
if ($show=='del') {
$fp = fopen ($file,'w');
fputs($fp,'');
fclose($fp);
echo '<br><a href="ip.php?show='.$pw.'" title="Admin">Admin</a>';
} // if($show=='del')
echo '</div>';
?>

 
ID: 837
eingestellt am: 19.07.2005
Autor: web-freak
Status zum lesen: Gast
gelesen: 9700
Webseite: www.dreamcodes.com
[Drucken]