makaiguy
08-19-2006, 01:13 AM
Working on a small PHP mailer form project on Apache v1.3.36 to sent html-formatted mail.
Form is POSTed with message text in a textarea named COMMENT. Some code I'm adapting uses the following to strip linefeeds and replace with html breaks:
$comment = preg_replace("/\n/","\n<BR>",$_POST[COMMENT]);
Only problem is that any apostrophes in the submitted message get a \ inserted before them. Thus "it's" becomes "it\'s" in the received mail.
I don't know beans about regular expressions. Can anybody help straighten this out?
Or is there something else that needs to be done to have apostrophes show up correctly?
Form is POSTed with message text in a textarea named COMMENT. Some code I'm adapting uses the following to strip linefeeds and replace with html breaks:
$comment = preg_replace("/\n/","\n<BR>",$_POST[COMMENT]);
Only problem is that any apostrophes in the submitted message get a \ inserted before them. Thus "it's" becomes "it\'s" in the received mail.
I don't know beans about regular expressions. Can anybody help straighten this out?
Or is there something else that needs to be done to have apostrophes show up correctly?