hey,
i have a guestbook script that takes input from a form and writes it to a text file.
when i write the message to the text file, the text is getting mangled when there are returns in the message (i.e. new lines)
this code writes the message to the text file.
$date = stripslashes($date);
$author = stripslashes($author);
$message = nl2br(stripslashes($message));
$fp = fopen($GLOBALS['guestbookfile'],"a");
fwrite($fp,"\n".$date."|".$author."|".$message);
fclose($fp);
for example :
12.05.2002|powlow|blaM<br />
M<br />
bla M<br />
M<br />
sim sim
should be :
12.05.2002|powlow|bla<br><br>bla<br><br>sim sim
those damn M are messing it all up!
i think the M is a newline and a carriage return.
any idea on how to use php functions or substitutions to get rid of them?
thanks for any help
-paulo