Ciao ragazzi, devo postarvi uno script che ho trovato...e non so come funziona..
codice:
//creo la tabella
CREATE TABLE 'online_table' ( ip text(15) NOT NULL , tempo bigint(20) NOT NULL , file text(50) NOT NULL );


//questa funzione in pratica quando la dovrei richiamare?

function get_online_users(){
$int=5;
$t=time();
$loop=$t-($int*60);
$ip=$_SERVER['REMOTE_ADDR'];
$fl=$_SERVER['PHP_SELF'];

if(!$sdbc=mysql_connect('mysql.server.host','user','password')){return -1;}
if(!mysql_select_db(db_name,$sdbc)){mysql_close($sdbc);return -1;}

$q0="INSERT INTO `online_table` (`ip`, `tempo`, `file`) VALUES ('$ip', '$t', '$fl')";
if(!mysql_query($q0))
{return -1;}

$q1="delete from `online_table` where `tempo`<'$loop'";
if(!mysql_query($q1))
{return -1;}

$q2='select distinct ip from `online_table`';
if(!$r=mysql_query($q2)){return -1;}

$online=mysql_num_rows($r);
mysql_close($sdbc);
return $online; 
}
La funzione la metto all'apertura del sito, oppure quando l'utente si logga?
Ditemi come comportarmi..
Grazie mille e buona giornata..