Hallo
Ich möchte von meinem Gästebuch die txt-datei online bearbeiten.
soweit so gut, aber es kommen da immer mehr backslashes, sobald ich erneut abspeichere.
Wie schaff ich es, dass es nicht immer neue backslashes erstellt?
das funktioniert nicht -.-
Ich möchte von meinem Gästebuch die txt-datei online bearbeiten.
soweit so gut, aber es kommen da immer mehr backslashes, sobald ich erneut abspeichere.
Wie schaff ich es, dass es nicht immer neue backslashes erstellt?
PHP-Code:
<?php
$text = str_replace("\n","<br>",$text);
$text = str_replace("\"",""",$text);
$text = str_replace("ä","ä",$text);
$text = str_replace("Ä","Ä",$text);
$text = str_replace("ö","ö",$text);
$text = str_replace("Ö","Ö",$text);
$text = str_replace("ü","ü",$text);
$text = str_replace("Ü","Ü",$text);
stripslashes($text);
if(isset($_POST['submit']))
{
$file = "../gb/guestbook.txt";
$text = $_POST["text"];
$bol=file_exists($file);
if($bol)
{
$dat=fopen($file,"w");
fwrite($dat,$text);
fclose($dat);
}
}
?>
<form action="<?php $PHP_SELF ?>" method="post">
<br>
<textarea name="text" cols="95" rows="25" id="text">
<?php readfile("../gb/guestbook.txt");?>
</textarea>
<br>
<p>
<INPUT TYPE="Submit" name="submit" VALUE=" Speichern " class="button">
<INPUT TYPE="reset" value=" Zurücksetzen " class="button">
</p>
</form>

Kommentar