Results 1 to 4 of 4

Thread: Mail Function

  1. #1
    Join Date
    Feb 2006
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Mail Function

    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.

  2. #2
    Join Date
    Apr 2009
    Location
    Mac OSX
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Its not a problem. its only at your code...

    what did you use anyways???
    PHP Code:
    "" 
    or
    PHP Code:
    '' 

  3. #3
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    This looks like magic quotes. run this:
    PHP Code:
    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:
    PHP Code:
    stripslashes($email); 
    before you send it. should clear things up.

  4. #4
    Join Date
    Feb 2006
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks guys!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •