Hi,
I have a PHP sendmail script (working) and I want to say:
- IF a checkbox is checked
- Then check for additional empty fields
- IF those additional fields are empty = redirect to an error page
- IF they are not empty = continue to submit and process the form as normal
The code i've managed to write myself does redirect if the additional fields are empty, but when they are populated (which is the aim) for some reason it doesn't continue to process the form. Any idea why!?
This is my PHP code snippet:
Code:// If checkbox is checked if($checkbox == '1'){ // Then check is field1 and field 2 are empty if (empty($field1) || empty($field2)) { // If field 1 or 2 are empty, redirect user to the errorURL header( "Location: $errorurl" ); exit ; } exit(); }



Reply With Quote


Bookmarks