Emperor
07-06-2005, 06:40 PM
Hi guys,
Here is some code:
MyForm.php
// compose mail message
$strMailMsg = "From: " . $_POST['inputName']; // cut for example
mail(...,$strMailMsg,...);
// now output what they sent
echo "<p>{$_POST['inputName']}</p>";
That works fine except when I get the mail it has the backslashes before any quotes.
So I tried this:
...
$strMailMsg=stripslashes($strMailMsg);
mail(...,$strMailMsg,...);
Well, now the mail doesn't have the slashes but the echo output does. I even tried a new variable:
$newMsg=stripslashes($strMailMsg);
mail(...,$newMsg,...);
It seems the stripslashes() affects the $_POST['inputName'] variable which to me seems absurd because the $strMailMsg should not be 'connected' to the $_POST['inputName'] after it's been assigned.
What's going on ?
Thanks.
Here is some code:
MyForm.php
// compose mail message
$strMailMsg = "From: " . $_POST['inputName']; // cut for example
mail(...,$strMailMsg,...);
// now output what they sent
echo "<p>{$_POST['inputName']}</p>";
That works fine except when I get the mail it has the backslashes before any quotes.
So I tried this:
...
$strMailMsg=stripslashes($strMailMsg);
mail(...,$strMailMsg,...);
Well, now the mail doesn't have the slashes but the echo output does. I even tried a new variable:
$newMsg=stripslashes($strMailMsg);
mail(...,$newMsg,...);
It seems the stripslashes() affects the $_POST['inputName'] variable which to me seems absurd because the $strMailMsg should not be 'connected' to the $_POST['inputName'] after it's been assigned.
What's going on ?
Thanks.