Hey i need help setting up an order form, when i hit submit it emails me whatever i put in the fields, but it doesnt check it if i leave email box empty ect, and it wont forward to paypal at end.
Will pay if needed.
The views expressed on this page by users and staff are their own, not those of NamePros.
I assume this is PHP based, so here's my PHP based answer:
You can check if the field is blank or not simply by putting a
Code:
if($_POST['email'] == "") {
die("You have not entered an email.");
}
You can also get a little fancy by using the eregi() function to verify that the inputted email is in the proper email format (*****@***.***). I advise googling the regular expression for email-format matching, as regexp's aren't my strong suit.
It is also possible to use JavaScript to make sure that it is filled out, but this can be problematic if the client has JavaScript disabled in their browser.