Hi I have created a form that I want results sent to my email but i want it to have required fields and make the form secure from spam. My php looks like this: Can someone help me make the fields required and secure from spam please?
Thanx
[PHP
<?php
$result = "Beechwood Homes website enquiry form\r\n\r\n";
$result .= "Developments: " . $Developments . "\r\n";
$result .= "Name: " . $Fname . "\r\n";
$result .= "Last Name: " . $Lname . "\r\n";
$result .= "Email: " . $Email . "\r\n";
$result .= "Tel: " . $Phone . "\r\n";
$result .= "Address: " . $Address . "\r\n";
$result .= "Address2: " . $Address2 . "\r\n";
$result .= "Town: " . $Town . "\r\n";
$result .= "County: " . $County . "\r\n";
$result .= "Postcode: " . $Postcode . "\r\n";
$result .= "Country: " . $Country . "\r\n";
$result .= "Min property price: " . $Minprice . "\r\n";
$result .= "Max property price: " . $Maxprice . "\r\n";
$result .= "Do you have a house to sell?: " . $Selling . "\r\n";
$result .= "How did you find this Web Site?: " . $Source . "\r\n";
$result .= "Please tick the box if you would like to be added to our mailing list: " . $Mailinglist . "\r\n";
if ($Email) {
$headers = "From: $Fname <$Email>\r\n\r\n";
} else {
$headers = "From: No Name given <anonymous@yourserver.com>\r\n\r\n";
}
$sendit = mail("my@email.co.uk", "Website contact form", $result, $headers) or die("Something went wrong");
echo "<meta http-equiv='refresh' content='0; url=thank.htm'>";
die;
?>
][/PHP]



Reply With Quote



Bookmarks