security - php Form to Email sanitizing -


im using following send contact type form, iv looked security , found need protect from: bit of mail function, ive hardcoded mean script spamproof / un-hijackable

$tenantname = $_post['tenan'];  $tenancyaddress = $_post['tenancy']; $alternativename = $_post['alternativ']; //and few more //then striptags on each variable  $to = "hardcoded@email.com"; $subject = "hardcoded subject here"; $message = "$tenantname etc rest of posted data"; $from = "noreply@email.com"; $headers = "from: $from";  mail($to,$subject,$message,$headers); 

unhijackable? yes.

spamproof? wouldn't describe that, form can still used spam target of form.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -