Forum Moderators: coopster
It all works fine except one issue, the blank field checker. This always activates regardless of whether the fields are blank or not.
Below is the code from the mail.php file that governs it:
//> Check that all fields have been completed
if (($email == "") ¦¦ ($subject == "") ¦¦ ($message == "")) {
readfile("blankfields.html");
exit;
} else {
}
Whatever I do I get this blankfields.html page whenever the form is submitted. Then I click "back" and "submit" again without changing anything and it goes through.
Any ideas how to fix it?
if ((empty($to) ¦¦ (empty($from) ¦¦ empty($email) ¦¦ empty($subject) ¦¦ empty($message) ¦¦ empty($tel)) {
readfile("blankfields.html");
exit;
} else {
}
And removing the $to since it is the hidden input of the email address where the form goes. I guess that field doesnt need to be checked since it cant be filled in.
I guess that field doesnt need to be checked since it cant be filled in.
This would allow you to check that (1) the hidden data is really being sent (as well as by what field name) and (2) that you are correctly receiving it in the php.
Simon
<p>To: <input type="hidden" name="to" value="sales@website.com">sales@website.com</p>
<p>From: <input type="text" name="from" value="<?php print $from;?>"></p>