Hello all. I am not a php programmer at all, but I need to find a simple solution to the forms I use. They are all way to easy to get crawled by spammers.
First problem is my email address is in the form code. How do I hide it?
Second how do I do a verification code?
Thrid: How do I require all fields to be filled in?
I need something easy.
This is the way I have it now... very basic send data php script
http://www.onlinecomputertips.com/
PHP Script:
<?php
$contents = $HTTP_SERVER_VARS['REMOTE_ADDR'] . " just entered this data into the form: " . $HTTP_POST_VARS['pageName'] . "\n\n";
//get the contents of the form from a post
while(list($key, $value) = each($HTTP_POST_VARS))
{
if($key == "sendto"){
$sendto = $value;
}
elseif($key == "redirectpage"){
$redirectpage = $value;
}
elseif($key == "subject"){
$subject = $value;
}
else
{
$contents .= "$key \t = \t $value \n";
}
}
//get the contents of a form from a get
while(list($key, $value) = each($HTTP_GET_VARS))
{
if($key == "sendto"){
$sendto = $value;
}
elseif($key == "redirectpage"){
$redirectpage = $value;
}
elseif($key == "subject"){
$subject = $value;
}
else
{
$contents .= "$key \t = \t $value \n";
}
}
//attach footer message
$from_header = "From: Online Computer Tips";
if($contents != "")
{
//send mail - $subject & $contents come from surfer input
mail($sendto, $subject, $contents, $from_header);
// redirect back to url visitor came from
header("Location: $redirectpage");
}
else
{
print($contents);
print("<HTML><BODY>Error, no data was submitted!");
print("</BODY></HTML>");
}
?>