Ciao a tutti, ho gia questo script:
[PHP]
$logfile= 'ip.html';
$IP = $_SERVER['REMOTE_ADDR'];
$logdetails= date("F j, Y, g:i a") . ': ' . '<a href=..../?checkip='.$_SERVER['REMOTE_ADDR'].' target=_blank>'.$_SERVER['REMOTE_ADDR'].'</a>';
// open the file for reading and writing
$fp = fopen($logfile, "r+");
// write out new log entry to the beginning of the file
fwrite($fp, $logdetails, strlen($logdetails));
fclose($fp);
[/PHP]
che mi logga chiunque entri in data pagina, come faccio a dirgli di farlo solo al click di un link?
ho provato cosi ma non va:
[PHP]<?php
function get_client_ip() {
$logfile= 'ip.log';
$IP = $_SERVER['REMOTE_ADDR'];
$logdetails= date("F j, Y, g:i a") . ': ' . '<a href=.../tools/city.ch?ip='.$_SERVER['REMOTE_ADDR'].' target=_blank>'.$_SERVER['REMOTE_ADDR'].'</a>';
$fp = fopen($logfile, "r+");
fwrite($fp, $logdetails, strlen($logdetails));
fclose($fp);
}
?>
<a href="#" onclick="get_client_ip()">CMON</a>[/PHP]
mi aiutate? grazie