**** removing slashes
Moderator: General Moderators
**** removing slashes
I have a form in Flash that I'm sending to a PHP script that is sending an e-mail. My problem is the I keep getting / before all ' I've tried stripslashes($mailMessage); but that doesn't seem to do the trick. Here's my code any help would be appreciated.
-Thanks
note: commented out code of things i've tried
<?
$siteName = "mySite.com";
$siteURL = "http://www.myURL.net";
$siteContact = "my@email.com";
$recipientEmail = "my@email.com";
$mailMessage = "Name: ".$senderName;
$mailMessage .= "\nCompany: ".$company;
$mailMessage .= "\nPhone: ".$phone;
$mailMessage .= "\nE-Mail: ".$eMail;
$mailMessage .= "\nAddress: ".$address;
$mailMessage .= "\nCity: ".$city;
$mailMessage .= "\nState: ".$state;
$mailMessage .= "\nZip: ".$zip;
$mailMessage .= "\nCountry: ".$country;
//stripslashes($mailMessage);
//htmlspecialchars($mailMessage);
//htmlentities($mailMessage);
//echo $mailMessage;
// Build up email header fields
$mailFrom = "From: $siteName <$siteContact>";
$mailTo = "$recipientEmail";
$mailSubject = "Message from $senderName";
// Send email
mail($mailTo, $mailSubject, $mailMessage, $mailFrom);
$response = "Message Sent";
// Respond to Flash movie!
print "&statusDisplay=$response&";
?>
-Thanks
note: commented out code of things i've tried
<?
$siteName = "mySite.com";
$siteURL = "http://www.myURL.net";
$siteContact = "my@email.com";
$recipientEmail = "my@email.com";
$mailMessage = "Name: ".$senderName;
$mailMessage .= "\nCompany: ".$company;
$mailMessage .= "\nPhone: ".$phone;
$mailMessage .= "\nE-Mail: ".$eMail;
$mailMessage .= "\nAddress: ".$address;
$mailMessage .= "\nCity: ".$city;
$mailMessage .= "\nState: ".$state;
$mailMessage .= "\nZip: ".$zip;
$mailMessage .= "\nCountry: ".$country;
//stripslashes($mailMessage);
//htmlspecialchars($mailMessage);
//htmlentities($mailMessage);
//echo $mailMessage;
// Build up email header fields
$mailFrom = "From: $siteName <$siteContact>";
$mailTo = "$recipientEmail";
$mailSubject = "Message from $senderName";
// Send email
mail($mailTo, $mailSubject, $mailMessage, $mailFrom);
$response = "Message Sent";
// Respond to Flash movie!
print "&statusDisplay=$response&";
?>
- dull1554
- Forum Regular
- Posts: 680
- Joined: Sat Nov 22, 2003 11:26 am
- Location: 42:21:35.359N, 76:02:20.688W
why do you have it commented out?
that might help....?!?!?!?!?!
there is no reason that
won't work.
that might help....?!?!?!?!?!
there is no reason that
Code: Select all
stripslashes();is it possible that: http://us4.php.net/manual/en/function.g ... es-gpc.php is off? its on by default but it can be off, that will screw up the stripslashes function. (not looking at your code, just giving my .02)
Use http://ca.php.net/stripslashes
Remember, it RETURNS the string without the slashes. You don't capture that output in your script.
Remember, it RETURNS the string without the slashes. You don't capture that output in your script.
For those offering help: Please, take the time to read the code and to read the post. It doesn't do anybody any good if you don't take the time to actually test what you are suggesting.
dull1554: Uncommenting stripslashes() won't do anything. I am also sure he had it uncommented before, and was only commented here. Heck, he even says so:
See, much nicer. =)
dull1554: Uncommenting stripslashes() won't do anything. I am also sure he had it uncommented before, and was only commented here. Heck, he even says so:
Finally, igbw: Use the PHP bbCode tags. They will highlight the code for you, and more importantly, for the people trying to help you. By using the bbCode tags, you may spot an error, and it just makes reading the post much easier.note: commented out code of things i've tried
Code: Select all
<?
$siteName = "mySite.com";
$siteURL = "http://www.myURL.net";
$siteContact = "my@email.com";
$recipientEmail = "my@email.com";
$mailMessage = "Name: ".$senderName;
$mailMessage .= "\nCompany: ".$company;
$mailMessage .= "\nPhone: ".$phone;
$mailMessage .= "\nE-Mail: ".$eMail;
$mailMessage .= "\nAddress: ".$address;
$mailMessage .= "\nCity: ".$city;
$mailMessage .= "\nState: ".$state;
$mailMessage .= "\nZip: ".$zip;
$mailMessage .= "\nCountry: ".$country;
//stripslashes($mailMessage);
//htmlspecialchars($mailMessage);
//htmlentities($mailMessage);
//echo $mailMessage;
// Build up email header fields
$mailFrom = "From: $siteName <$siteContact>";
$mailTo = "$recipientEmail";
$mailSubject = "Message from $senderName";
// Send email
mail($mailTo, $mailSubject, $mailMessage, $mailFrom);
$response = "Message Sent";
// Respond to Flash movie!
print "&statusDisplay=$response&";
?>No, no need to apologize guys. I didn't mean to sound like I was <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>. It's just my job to be anal. =)
The point was to say: Read, write, edit, reread, edit, post. In other words, make sure you read everything, then write your response. Then go back and edit your response for spelling and grammar (yes, spelling and grammar make a big difference), reread what the person wrote, and then what you wrote, edit if you need to, then post.
No harm, no worries.
The point was to say: Read, write, edit, reread, edit, post. In other words, make sure you read everything, then write your response. Then go back and edit your response for spelling and grammar (yes, spelling and grammar make a big difference), reread what the person wrote, and then what you wrote, edit if you need to, then post.
No harm, no worries.
igbw: No, try looking at [php_man]stripslashes[/php_man]($mailMessage); again.
You see, you are just calling the function. But if you look at the manual, [php_man]stripslashes[/php_man] returns something (the cleaned string).
So what you really want is this:
You see, you are just calling the function. But if you look at the manual, [php_man]stripslashes[/php_man] returns something (the cleaned string).
So what you really want is this:
Code: Select all
$mailMessage = stripslashes($mailMessage);