You are here: Help - stripping special characters from email and retaining html tags « PHP Programming Language « IT news, forums, messages
Help - stripping special characters from email and retaining html tags

Posted by Big Moxy on 10/08/07 17:30

I want to send html formatted text yet strip out special characters
(e.g. quotes and semi colons). I've seen preg_replace examples like
$messageout = preg_replace('/[^0-9a-z\[\]\(\)<>]/i','',$message); to
preserve some additional characters but don't know how to approach
preserving html in general.

This is a typical message line: $message.= "<b>Date: </b>" . $today .
"<br />";

I am setting these headers:

$headers = "MIME-Version: 1.0\r\n";
$headers.= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers.= "From: $emailaddress\r\n";

Also, where can I find out which characters need to be escaped?

Please advise.

Thank you!
- Tim

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация