Did you upload the form-process.php file to the sub-directory "test/php/" in your website root directory - i.e. sub-directory "php" in sub-directory "test".
Well, thanks for the mini-video and the form-process.php code at hastebin - very professionally presented
However, it would be more efficient to let HTML5 do your error checking by altering each of your form's input elements slightly. e.g. ...
From:
HTML:
To:
HTML:
You should then remove the line, I asked you to insert -
PHP:
var_dump($_POST);exit;
and this now superfluous code in your form-process.php file:-
PHP:
// NAME
if (empty($_POST["name"])) {
$errorMSG = "Name is required ";
} else {
$name = $_POST["name"];
}
// EMAIL
if (empty($_POST["email"])) {
$errorMSG .= "Email is required ";
} else {
$email = $_POST["email"];
}
// MESSAGE
if (empty($_POST["message"])) {
$errorMSG .= "Message is required ";
} else {
$message = $_POST["message"];
}
This done, theoretically your code should work - but let's see what transpires ...
Via this link, but I, like many users, find this process tedious. Why not think outside the box and do your own Bot protection?
It's easily done as outlined in this link ...
Interesting, so how would I write the conditional statement, if that hidden text box is filled then the email would be sent to nowhere? Meaning, I would have an alternative email address to direct it to?
If that hidden input field (text box) was filled, then it would not have been done by a user, but by a SpamBot! - ergo, you would write your conditional like so:
PHP:
// If our hidden field is empty then it's a legit send
if(!$_REQUEST['honey-pot'])
{
// process the legit email code here
}
// If it's got stuff in there, then it's a dumb Bot, so do nothing.
This way you only process the email if it's a legitimate contact message
A forum community dedicated to tech experts and enthusiasts. Come join the discussion about articles, computer security, Mac, Microsoft, Linux, hardware, networking, gaming, reviews, accessories, and more!