Form processing cancel HELP
Moderator: General Moderators
-
mcoelho123
- Forum Commoner
- Posts: 37
- Joined: Tue Jun 06, 2006 6:27 am
Form processing cancel HELP
How can i do to cancel a form processing if a value is blank?
-
mcoelho123
- Forum Commoner
- Posts: 37
- Joined: Tue Jun 06, 2006 6:27 am
In mail.php just put something like:
You can also put some javascript on the client side, but don't rely on this as "validation" - javascript should be seen as something to save the user waiting for a round trip to the server.
Code: Select all
$fieldName = $_POST['fieldName'];
// if you are going to store $fieldName in a database, make sure you escape it here.
if($fieldName == "") {
Die("The field can't be blank!");
}
...