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
Alles anzeigen
<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
- <form action="<? $PHP_SELF ?>" method="post"><h1>Chat</h1><br><br><table align="center" border="1" rules="all">
- <colgroup><col width="50%"><col width="50%"></colgroup>
- <tbody>
- <tr><th colspan="2">Deine Nachricht:</th></tr><tr><td colspan="2"><input type="text" name="eingabe" class="IGBTITLE"></td></tr>
- <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.';"
- onMouseout="document.getElementById('.$strich.'btn_1'.$strich.').src = '.$strich.'btn/btn_save_n.gif'.$strich.';"></th></tr>
- </table></form>
Quellcode
- <?
- $f3 = "chat/anz.txt";
- $var_chat = str_replace("\n","", $_POST["eingabe"]);
- $var_nick = $_SESSION["benutzer"];
- if(!empty($var_chat))
- {
- $eintrag1 = "/!<br>".$var_nick."/!".$var_chat;
- $f1 = fopen($datei1, "a+");
- fwrite($f1, $eintrag1);
- fclose($f1);
- header ("Refresh: 2");
- }
- include('formular/chat.php');
- ?>