DeX Posted August 15, 2010 Share Posted August 15, 2010 I have a drop down box like so: <select name="form1[20][Coverall Type]" id="Coverall Type" value="" onmouseover = "hint('Select overall type', 'coverallHint')" onmouseout = "nohint('coverallHint')" > <option value = "Short (5'2 - 5'7, 2'7 inseam)">Short (5'2" - 5'7", 27" inseam)</option> <option value = "Regular (5'8" - 6'0", 28.5" inseam)">Regular (5'8" - 6'0", 28.5" inseam)</option> <option value = "Long (6'1" - 6'2", 30" inseam)">Long (6'1" - 6'2", 30" inseam)</option> <option value = "X-Long">X-Long</option> </select> And I email it with PHP like so: $message = ""; $form = $_POST['form1']; // Loop array foreach($form as $rowid => $columnarray) { // Loop each column for this row foreach($columnarray as $column => $value) { $message .= $column . ": " . $value . "\n"; } } //define the headers we want passed. Note that they are separated with \r\n $headers = "From: ******@*****.com\r\nReply-To: *****@******.com"; //send the email $mail_sent = @mail( $to, $subject, $message, $headers ); But when I get the email, it looks like so: Coverall Size: 30 Coverall Type: Short (5\'2 - 5\'7, 2\'7 inseam) So as you can see, it inserts the slashes to escape the quote characters. I'm also trying to put double quotes in there for inches but I'm just working on the single quotes right now. Any idea why it's doing this? How do I stop it? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/210802-quotes-keep-getting-escaped-by-slashes/ Share on other sites More sharing options...
wildteen88 Posted August 15, 2010 Share Posted August 15, 2010 Your PHP configuration most probably has a setting called magic_quotes enabled. Which automatically escapes quotes in variables such as _GET, _POST, _COOKIE etc. Reading this will help you http://php.net/manual/en/security.magicquotes.php Quote Link to comment https://forums.phpfreaks.com/topic/210802-quotes-keep-getting-escaped-by-slashes/#findComment-1099630 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.