Having a problem in my php form
Posted: Fri Jul 02, 2010 10:33 am
Hi,
I have created a form which collects data from my html form and sends to my email address.
Everything is alright but if a user puts a ' or " in his message my php form will append a slash / to it and will send to me!
here is my code:
anyone knows why this happens?
<?
// Create Message Text
foreach($_POST as $key => $value) {
if(!in_array($key, array("Submit"))) {
$message .= "$key : = $value \n";
}
}
$valid = $img->check($_POST['Captcha']);
mail("sales@domain.com", "zyx", $message, "From:" . $HTTP_POST_VARS['TransferorEmail']);
header("location:http://www.domain.com/ok.html");
I have created a form which collects data from my html form and sends to my email address.
Everything is alright but if a user puts a ' or " in his message my php form will append a slash / to it and will send to me!
here is my code:
anyone knows why this happens?
<?
// Create Message Text
foreach($_POST as $key => $value) {
if(!in_array($key, array("Submit"))) {
$message .= "$key : = $value \n";
}
}
$valid = $img->check($_POST['Captcha']);
mail("sales@domain.com", "zyx", $message, "From:" . $HTTP_POST_VARS['TransferorEmail']);
header("location:http://www.domain.com/ok.html");