Speichert in mehreren Zeilen

  • Speichert in mehreren Zeilen

    Also ich habe Folgendes Problem ich will was in eine Datei schreiben. Nur schreibt sie dieses so

    <br>Nick1/!Text1/!
    <br>Nick2/!Text2/!
    ...

    So aber ich will das alles in einer Reihe steht so das mann das einfach in eine Arrya laden kann.

    Hier mal die Quelltexte

    Quellcode

    1. <form action="<? $PHP_SELF ?>" method="post"><h1>Chat</h1><br><br><table align="center" border="1" rules="all">
    2. <colgroup><col width="50%"><col width="50%"></colgroup>
    3. <tbody>
    4. <tr><th colspan="2">Deine Nachricht:</th></tr><tr><td colspan="2"><input type="text" name="eingabe" class="IGBTITLE"></td></tr>
    5. <tr><th colspan="2"><input type="image" src="btn/btn_save_n.gif" id="btn_1" tabindex="50" onMouseover="document.getElementById('.$strich.'btn_1'.$strich.').src = '.$strich.'btn/btn_save_h.gif'.$strich.';"
    6. onMouseout="document.getElementById('.$strich.'btn_1'.$strich.').src = '.$strich.'btn/btn_save_n.gif'.$strich.';"></th></tr>
    7. </table></form>


    Quellcode

    1. <?
    2. $f3 = "chat/anz.txt";
    3. $var_chat = str_replace("\n","", $_POST["eingabe"]);
    4. $var_nick = $_SESSION["benutzer"];
    5. if(!empty($var_chat))
    6. {
    7. $eintrag1 = "/!<br>".$var_nick."/!".$var_chat;
    8. $f1 = fopen($datei1, "a+");
    9. fwrite($f1, $eintrag1);
    10. fclose($f1);
    11. header ("Refresh: 2");
    12. }
    13. include('formular/chat.php');
    14. ?>
    Alles anzeigen