Click to See Complete Forum and Search --> : Problem with ' and \' in email


theBody44
09-08-2004, 08:04 PM
Well, I'm moving into PHP from an ASP background and I'm having trouble with 1 thing. I'm creating a simple user email form and submitting/sending it via PHP.mail($to, $subject, $message, "From: $email" );If I type:
"Hello, I'm creating a test page", the email is sent as:
"Hello, I\ 'm creating a test page".
(no space between "\" and " ' ", I just needed it to show up as two elements and not just an apostrophe)

The message is stored like so:$message = $_REQUEST['message'];and then used in the code above. If someone could inform me on how to eliminate this "\" before the ', that would be great!!:D Thanks.

pyro
09-08-2004, 09:38 PM
stripslashes() (http://www.php.net/stripslashes)

theBody44
09-08-2004, 10:01 PM
Thanks - exactly what I was looking for:D !!