Jump to content

Quotes keep getting escaped by slashes


DeX

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.