(Another quite newbie...)
I have already an online booking form. The Form works fine now and I would like to add on one more issue, but the code ignores what I want to check. I have 4 fields: arrival, departure, no. of persons and comments to check.
Scenario 1:
All field mentioned above are emtpty: Workes fine and message appears: "You have not provided any booking details".
Scenario 2:
If arrival (date_start) and departure (date_end) is entered, there should be at least an entry either in the field "comment", or in the field "pax". If not, there should be a message: "You have not provided sufficient booking details".
INSTEAD: The booking request is sent, which should not be the case.
The code is currently:
# all fields empty : arrival, departure, pax and comments - error
if(empty($data_start) && empty($data_end) && empty($pax)&& empty($comment)){
exit("You have not specified any booking details to submit to us.
<br>Please use your browser to go back to the form.
<br>If you experience problems with this Form, please e-mail us");
exit;
}
#If arrival and departure date is entered, there should be at least an entry
either in the field "comment", or in the field "pax".
if(!isset($data_start) && !isset($data_end) && empty($pax) && empty($comment)){
exit("You have not provided sufficient booking details.
<br>Please use your browser to go back to the form.
<br>If you experience problems with this Form, please e-mail us");
exit;
}
The form can be tested at http://www.phuket-beachvillas.com/contact-own/contact-it.php
Can someone please check and tell me what's wrong with the code ? Thanks to anyone for any hint.