Just out of curiousity, how do you validate that something like this is coming from within the server?
there is a link up above that leads to a google search, there are tons of ways to validate info using a server side script or javascript. For example
You could do something like this:
<?php
$to = "Email@email.com";
$from = " Your Website";
$test="2";
if($_POST['Name']==""){
$test="1";
}
if($_POST['Email']==""){
$test="1";
}
if($_POST['Number']==""){
$test="1";
}
if($_POST['Message']==""){
$test="1";
}
if($test=="1")
{
echo "<html><head>
<meta http-equiv=\"refresh\" content=\"10;url=contact.html\"/>
</head>
<body bgcolor=\"black\">
<font color=\"red\"><h1>There was an Error, Please ensure you filled in all the fields!</h1></font>
</body></html>
";
}
else{
$subject = "Website Submission";
$name = $_POST['Name'];
$email = $_POST['Email'];
$number = $_POST['Number'];
$message = $_POST['Message'];
$body=
"
Name: $name\n
Email: $email\n
Number: $number\n
Message: $message
";
$headers = "From: $from \n";
mail($to, $subject, $body, $headers);
echo "<html>
<head>
<meta http-equiv=\"refresh\" content=\"5;url=index.html\"/>
</head>
<body bgcolor=\"black\">
<font color=\"white\">Thank You! Your form was sent successfully</font>
</body>
</html>
";
}
?>
But this is just simple verification in PHP, I don't have much knowledge of PHP so this is the best I can do. With javascript you have a ton of ways you can verify it in great detail, and have it validate instantly on the same page they filled out the form. So I would only use this verification as a backup incase they have javascript disabled.