1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need help fixing my email script

Discussion in 'PHP' started by Colleen, Jun 10, 2005.

  1. #1
    A few months back I had an email script custom made for me.

    My only issue is that when people put a " or a ' in the form and send it, it sends to me with a \ in front of it.

    For example:

    This
    1- 12" & 1- 14"
    SEMrush
    Comes out like this
    1- 12\" & 1- 14\"

    My client gets a copy of emails to print up, as I am using the script for them as well and I'd like to know what I need to do to stop the script from outputting those \ things. I know it's used to escape certain symbols, etc, I just need to know how to stop it from sending it in the email.

    Thanks for any help.
     
    Colleen, Jun 10, 2005 IP
    SEMrush
  2. mushroom

    mushroom Peon

    Messages:
    369
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The web server is adding them, this is good as they can mess things up in php, if they are not added.

    For your e-mail you want them out, so take the varible containing the text ($var as an example) and run a statment like this
    $new_var=stripslashes($var);
    PHP:
    before insterting the new_var in your e-mail script.
     
    mushroom, Jun 10, 2005 IP
  3. Colleen

    Colleen Illustrious Member

    Messages:
    6,778
    Likes Received:
    725
    Best Answers:
    1
    Trophy Points:
    430
    #3
    Thanks, mushroom.

    My script does have something like that.
    $comment2 = stripslashes($comments);
    PHP:
    But it's not stopping the slashes, I am not sure what else to be looking at, any ideas?

    Thanks.
     
    Colleen, Jun 10, 2005 IP
  4. mushroom

    mushroom Peon

    Messages:
    369
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That should have done it, with out see the script it's hard to tell.

    Unless $comments not $comment2 is apearing inside of "mail( );"

    PM me if you do not wish post the script.
     
    mushroom, Jun 10, 2005 IP