sdasevne
01-02-2008, 05:38 PM
In my email form submit program, I added a statement like that shown below to change any backslashes (\) to another character, to prevent the injection of newline or return characters that might make it possible for spammers to enter bcc: or other unwanted mail parameters.
When I add this line, I get an Undefined Variable error message. Can someone tell me what I have to do to scan each field and replace all slashes?
foreach ($_POST as $Field=>$Value)
{
// $Value = str_replace("\","?",$Value); <--- causes an error message
$MsgBody .= "$Field: $Value\n";
}
When I add this line, I get an Undefined Variable error message. Can someone tell me what I have to do to scan each field and replace all slashes?
foreach ($_POST as $Field=>$Value)
{
// $Value = str_replace("\","?",$Value); <--- causes an error message
$MsgBody .= "$Field: $Value\n";
}