VORREI CHE nel mio sito venissero visualizzati i nomi degli utenti on line: ho preso lo script da una chat in flash ottenendo QUESTO ...
Metto il nome e entro inviando il comando al file login.php:
<?
header("Expires: ".gmdate("D, d M Y H:i:s")."GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
?>
<?
/* Modified for Flashkit by swissLyons: http://www.flashbuilder.ch based on the http://www.peopleforfun.com version */
/* Original script by Nicola Delbono <key5@key5.com> */
?>
<?
$nickname = str_replace ("\n"," ", $nickname);
$nickname = str_replace ("<", " ", $nickname);
$nickname = str_replace (">", " ", $nickname);
$nickname = stripslashes ($nickname);
?>
&login=
<?
$date = date( "H:i");
$chat_file = "login.txt";
$chat_lenght =10;
$max_single_msg_lenght = 50000;
$max_file_size = $chat_lenght * $max_single_msg_lenght;
$file_size= filesize($chat_file);
if ($file_size > $max_file_size) {
$lines = file($chat_file);
$a = count($lines);
$u = $a - $chat_lenght;
for($i = $a; $i >= $u ;$i--){
$msg_old = $lines[$i] . $msg_old;
}
$deleted = unlink($chat_file);
$fp = fopen($chat_file, "a+");
$fw = fwrite($fp, $msg_old);
fclose($fp);
}
if ($nickname != ""){
$fp = fopen($chat_file, "a+");
$fw = fwrite($fp, "$date - $nickname enters \n");
fclose($fp);}
$lines = file($chat_file);
$a = count($lines);
$u = $a - $chat_lenght;
for($i = $a; $i >= $u ;$i--){
echo $lines[$i];
}
?>
IL LOGOUT.php è:
<?
header("Expires: ".gmdate("D, d M Y H:i:s")."GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
?>
<?
/* Modified for Flashkit by swissLyons: http://www.flashbuilder.ch based on the http://www.peopleforfun.com version */
/* Original script by Nicola Delbono <key5@key5.com> */
?>
<?
$nickname = str_replace ("\n"," ", $nickname);
$nickname = str_replace ("<", " ", $nickname);
$nickname = str_replace (">", " ", $nickname);
$nickname = stripslashes ($nickname);
?>
&login=
<?
$date = date( "H:i");
$chat_file = "login.txt";
$chat_lenght = 10;
$max_single_msg_lenght = 50000;
$max_file_size = $chat_lenght * $max_single_msg_lenght;
$file_size= filesize($chat_file);
if ($file_size > $max_file_size) {
$lines = file($chat_file);
$a = count($lines);
$u = $a - $chat_lenght;
for($i = $a; $i >= $u ;$i--){
$msg_old = $lines[$i] . $msg_old;
}
$deleted = unlink($chat_file);
$fp = fopen($chat_file, "a+");
$fw = fwrite($fp, $msg_old);
fclose($fp);
}
if ($nickname != ""){
$fp = fopen($chat_file, "a+");
$fw = fwrite($fp, "$date - $nickname exits\n");
fclose($fp);}
$lines = file($chat_file);
$a = count($lines);
$u = $a - $chat_lenght;
for($i = $a; $i >= $u ;$i--){
echo $lines[$i];
}
?>
VORREI CHE QUALCUNO MI AIUTASSE A MODIFICARE IL LOGOUT.PHP (NEL FORUM PHP X ORA NON MI AIUTANO) IN MODO TALE DA FAR SCOMPARIRE IL NOME AL MOMENTO DEL LOGOUT INVECE DI VISUALIZZARE "XXX EXITS".
GRAZIE