Zozart
15-03-2004, 22:46
Okay, I've been messing around with file-changing functions with PHP and all is well except for one thing.
I have this for my form:
<form action='end.php' method='POST'>
<input type='text' name='user'>
<?php br(3); ?>
<textarea name='text' rows='5' cols='40'></textarea>
<?php br(3); ?>
<?php br(3); ?>
<input type='submit' value='Okay'>
</form>
And that works okay, then on the recieving end I've written this:
$file = "data.zyon";
if (!file_exists($file))
die("Error: File does not exist");
$fi = fopen($file,"a+");
$text.="<p class='spacer' />";
fwrite($fi,$text);
$size = filesize($file);
fclose($fi);
@include "$file";
And, as I expected, that outputs the contents of the newly written zyon.data file.
But there's one problem.. When I try to use punctuation (most noticablely apostrophies), php automatically seems to insert a \ in front of them.
I can recollect that \ is used to escape characters, but I can't figure out why php is throwing it in here.
So any answers as to why, and preferably, how to remove it, would be appreciated, thanks :D
I have this for my form:
<form action='end.php' method='POST'>
<input type='text' name='user'>
<?php br(3); ?>
<textarea name='text' rows='5' cols='40'></textarea>
<?php br(3); ?>
<?php br(3); ?>
<input type='submit' value='Okay'>
</form>
And that works okay, then on the recieving end I've written this:
$file = "data.zyon";
if (!file_exists($file))
die("Error: File does not exist");
$fi = fopen($file,"a+");
$text.="<p class='spacer' />";
fwrite($fi,$text);
$size = filesize($file);
fclose($fi);
@include "$file";
And, as I expected, that outputs the contents of the newly written zyon.data file.
But there's one problem.. When I try to use punctuation (most noticablely apostrophies), php automatically seems to insert a \ in front of them.
I can recollect that \ is used to escape characters, but I can't figure out why php is throwing it in here.
So any answers as to why, and preferably, how to remove it, would be appreciated, thanks :D