Log in

View Full Version : Mail Function



InNeedofHelp
06-23-2009, 06:23 AM
I'm working on a website with some friends and we've set up a Report A Bug page where the user enters what browser they're using, and describes the bug in a textarea. The page then submits, and an email is sent to us containing their report. We've found that in the emails we recieve, PHP slightly alters the message by putting a \ before every special character.

Example email that we recieve:

Hi, I\'m having trouble logging in. What\'s the problem?


How (and where) do we fix it so that the email reads normally?
Thanks.

n1tr0b
06-23-2009, 11:42 AM
Its not a problem. its only at your code...

what did you use anyways???


""

or


''

traq
06-23-2009, 03:30 PM
This looks like magic quotes. run this:


if(get_magic_quotes_gpc())
echo "Magic quotes are enabled";
else
echo "Magic quotes are disabled";

to see if they're turned on on your server (which is likely). They're designed to escape characters which could be used for a sql injection attack. to get rid of them, take your email submission (say you call it $email) and add this:


stripslashes($email);

before you send it. should clear things up.

InNeedofHelp
06-23-2009, 06:00 PM
Thanks guys!