php Form to Email sanitizing
Posted
by Jacob
on Stack Overflow
See other posts from Stack Overflow
or by Jacob
Published on 2010-04-30T10:50:17Z
Indexed on
2010/04/30
12:37 UTC
Read the original article
Hit count: 263
Hi,
im using the following to send a contact us type form, iv looked into security and only found that you need to protect the From: bit of the mail function, as ive hardcoded this does that mean the script is spamproof / un-hijackable
$tenantname = $_POST['tenan']; $tenancyaddress = $_POST['tenancy']; $alternativename = $_POST['alternativ //and a few more
//then striptags on each variable
$to = "[email protected]"; $subject = "hardcoded subject here"; $message = "$tenantname etc rest of posted data"; $from = "[email protected]"; $headers = "From: $from";
mail($to,$subject,$message,$headers);
© Stack Overflow or respective owner