Visualizzazione dei risultati da 1 a 2 su 2

Discussione: CHAT FLASH/PHP

  1. #1

    CHAT FLASH/PHP

    Ciao ragazzi...per favore mi aiutate a risolvere questo problema? sto cercando di farmi il sito (http://www.k-k.it) da solo e nell'inserimento di questa chat qualcosa non funziona.....non so dove sbaglio!!!:

    /////////////Tasto Enter(inizio chat)/////////////

    tastoEnter.on (release, keyPress "<Enter>") {
    loadVariablesNum("login.php", 0, "POST");
    if (nickname eq "") {
    nick = "Devi Scegli un Nick Per Entrare...";
    gotoAndStop("registrazione");
    } else {
    _root.gotoAndStop("chattiamo");
    }
    }

    ////////Taso Invio(per inserire quello che si scrive)////////////

    tastoInvio.on (release) {
    loadVariablesNum("logout.php", 0, "POST");
    gotoAndStop("arrivederci");
    }

    /////////tasto esc///////

    superExit.on (release) {
    _root.gotoAndStop("registrazione");
    }

    QUESTA CHAT COMUNICA CON UN FILE PHP "CHAT.PHP":

    <?
    header("Expires: ".gmdate("D, d M Y H:i:s")."GMT");
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
    ?>

    <?
    // Fabio
    $nickname=$_REQUEST['nickname'];
    $message=$_REQUEST['message'];
    //

    $nickname = str_replace ("\n"," ", $nickname);
    $nickname = str_replace ("<", " ", $nickname);
    $nickname = str_replace (">", " ", $nickname);
    $nickname = stripslashes ($nickname);
    ?>

    &output=
    <?
    $chat_file = "chat.txt";
    $chat_lenght = 40;
    $max_single_msg_lenght = 100000;
    $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);
    }
    $msg = str_replace ("\n"," ", $message);

    $msg = stripslashes ($msg);
    if ($msg != ""){
    $fp = fopen($chat_file, "a+");
    $fw = fwrite($fp, "$nickname : $msg\n");
    fclose($fp);}
    $lines = file($chat_file);
    $a = count($lines);
    $u = $a - $chat_lenght;
    for($i = $a; $i >= $u ;$i--){
    echo $lines[$i];
    }

    ?>

    COMUNICA ANCHE CON UN FILE PHP "LOGIN.PHP":

    <?
    header("Expires: ".gmdate("D, d M Y H:i:s")."GMT");
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
    ?>

    <?
    // Fabio
    $nickname=$_REQUEST['nickname'];
    //
    $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 c'è\n");
    fclose($fp);}
    $lines = file($chat_file);
    $a = count($lines);
    $u = $a - $chat_lenght;
    for($i = $a; $i >= $u ;$i--){
    echo $lines[$i];
    }
    ?>

    COMUNICA ANCHE CON UN FILE PHP "LOGOUT.PHP":

    <?
    header("Expires: ".gmdate("D, d M Y H:i:s")."GMT");
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
    ?>

    <?
    // Fabio
    $nickname=$_REQUEST['nickname'];
    $message=$_REQUEST['message'];
    //
    $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 fuori\n");
    fclose($fp);}
    $lines = file($chat_file);
    $a = count($lines);
    $u = $a - $chat_lenght;
    for($i = $a; $i >= $u ;$i--){
    echo $lines[$i];
    }
    ?>


    PER FAVORE MI DATE QUALCHE DRITTA SU DOVE SBAGLIO? GRAZIE!!
    Fuggi quello studio del quale la risultante opera more coll'operante d'essa. Leonardo Da Vinci

  2. #2
    ho risolto da solo!!!!! grazie!!
    Fuggi quello studio del quale la risultante opera more coll'operante d'essa. Leonardo Da Vinci

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.