Hello All, 

I've created a "Mail this section" option for a FAQ/Information Center type 
page I'm working on.

It enables visitors to email themselves the contents of a particular section. 
But I'm running into trouble
when foreign/non a-zA-Z0-9 characters are present in the code (which is being 
pulled from the database).


Heres' a code snippet:


            $body .= "<a href=\"mailto:?Subject=Information Center&body="
                  . html_entity_decode(strip_tags(
                    str_replace(array("&", '"', "\\"), "", 
$dbObject->result['body']))) . "\""
                  . " class=\"email\">Email this section</a>";

Let me reformat that, heh:
$body = "<a href=\"mailto:?Subject=Information Center&body=". 
$dbObject->result['body'] . "\">Email me</a>";

So, what can I use on $dbObject->result['body'] to clean/strip away the text? 
You can see I was messing
with a few different options..I know & will break it, as well as " ... but lets 
just clear out everything (HTML, and all other characters EXCEPT aA-zZ 0-9 and 
maybe .,-

Any help, greatly appreaciated!

- Ben
 

Ben Sgro, Chief Engineer
ProjectSkyLine - Defining New Horizons

This e-mail is confidential information intended only for the use of the 
individual to whom it is addressed.
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to