When I send mail using the form on my site, all the ' marks have \ marks right before them. For instance, if I send
It was Eric's birthday
using my webform, I'll get an email saying
It was Eric\'s birthday
How can I get rid of that \ ?
Getting rid of \' when sending mail
Moderator: General Moderators
this is something that I use regularly.
Code: Select all
if (get_magic_quotes_gpc() )
{
$fnStripMagicQuotes = create_function('&$mData, $fnSelf',
'if (is_array($mData)) foreach ($mData as $mKey=>$mValue) $fnSelf($mData[$mKey], $fnSelf); '.
'else $mData = stripslashes($mData);');
$fnStripMagicQuotes($_POST,$fnStripMagicQuotes);
$fnStripMagicQuotes($_GET,$fnStripMagicQuotes);
$fnStripMagicQuotes($_COOKIE,$fnStripMagicQuotes);
$fnStripMagicQuotes($_SERVER,$fnStripMagicQuotes);
} // end if
if (get_magic_quotes_runtime())
{
set_magic_quotes_runtime(0);
}