Jump to content

keyboarder

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

keyboarder's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. (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.
  2. BINGO ! I got it myself ! Thanks anyway ! :D The string is now: # arrival, departure given, but pax empty if(!isset($data_start) && !isset($data_end)){       exit(); } if(empty($pax)){            exit("Please tell us the number of persons in your group."); }
  3. @BlueSkyIS:) Thanks ! That resolves the parse error, but unfortunately not the issue. The script does not realize that the field "pax" is left blank. Ideally that string should read: If "data_start" not blank AND "data-end" not blank, BUT "pax" is blank, then send error message. For test purpose: www.phuket-beachvillas.com/contact-it/contact-it.php Maybe you have any clue ?
  4. OK, no problem anymore. The Form works fine now and I would like to add on one more issue, but the code below resolves is a parse error at the last "if"-line. (I,m still learning...) Scenario: I have 3 fields: "arrival", "departure" and "no. of persons" (pax) to check. When arrival (date_start) is entered and departure (date_end) is entered, there should be an entry in the field "pax" as well. If not, there should be a message: "please tell us the number of persons in your group". The code is currently: # arrival, departure and comments empty (works fine): } if(empty($data_start) && empty($data_end) && empty($comment)){ exit("You have not specified any details to submit to us."); } # arrival, departure given, but pax empty (resolves in parse error): if(!isset($data_start) && if(!isset($data_end)) && if(empty($pax)){ exit("Please tell us the number of persons in your group."); } Error: Parse error: syntax error, unexpected T_IF in /home/xxxx/xxxx (last line). Can someone please check and tell me what's wrong with the last string ? Thanks to anyone for any hint.
  5. OOOPS... sorry to bother you again, but it resolves in a parse error. My code is now: <option value="VISA" <?php echo $_GET['payment'] == 'VISA' ? 'selected="selected"' : ''; ?>>VISA</option> <option value="MASTER" <?php echo $_GET['payment'] == 'MASTER' ? 'selected="selected"' : ''; ?>>MASTER</option> <option value="CASH" <?php echo $_GET['payment'] == 'CASH' ? 'selected="selected"' : ''; ?>>CASH</option> <option value="T/T Banktransfer" <?php echo $_GET['payment'] == 'Banktransfer' ? 'selected="selected"' : ''; ?>>T/T Banktransfer</option> <option value="" <?php if( !isset$_GET['payment'] || empty($_GET['payment']) ) { echo 'selected="selected"'; } ?>>Please select</option> I'm simply not "pro" enough to solve this issue, but I've done a lot of studies (and copies) to get my form (URL above) perfect and I would hate to give up... (guess you know what I mean ?). BTW.: Yes, better to start a new thread and I did (http://www.phpfreaks.com/forums/index.php/topic,310607.new.html#new). But I saw how active you are and read your qualified past posts and therefore directed this issue to you once more... Hope not to bother you too much ?
  6. Correction: Thanks Pikachu2000, the first option "VISA" filled in was my mistake, but unfortunately it doesn't work anyway. The entries are not remembered. (Once again if you try the form: For now there must be any entry in the message box. Otherwise error. I'll correct that later on)
  7. [quote author=Pikachu2000 link=topic=101449.msg1467079#msg1467079 date=1285086870] Off the top of my head . . . [code] <option value="VISA" <?php echo $_GET['payment'] == 'VISA' ? 'selected="selected"' : ''; ?>>VISA</option> <option value="MASTER" <?php echo $_GET['payment'] == 'MASTER' ? 'selected="selected"' : ''; ?>>MASTER</option> <option value="CASH" <?php echo $_GET['payment'] == 'CASH' ? 'selected="selected"' : ''; ?>>CASH</option> <option value="T/T Banktransfer" <?php echo $_GET['payment'] == 'Banktransfer' ? 'selected="selected"' : ''; ?>>T/T Banktransfer</option> [/code] [/quote] Thanks Pikachu2000, but unfortunately it doesn't work. Instead the form comes now with the first option "VISA" filled in. If you want to try, there's a test at - www.phuket-beachvillas.com/contact/index.php (For now there must be any entry in the message box. Otherwise error. I'll correct that later on)
  8. I don't know where else to put this: Issue: When submitted with the wrong verification code, all data entered into my online form was lost (blanked out) and the form returned correctly with message "wrong verification code", However, going through this great forum I managed to get all - manually entered - data returned back with same content ! Great ! I placed  value="<?php echo $_GET['the_field_name'];?>"/  after each input field. BUT... not so with input fields entered from drop-down menu ! Now my question is: How do I put a similar string for the drop-down menu field "Payment by" in this sample: <tr> <td class="table-inquire" width="47%"> <font face="Verdana" size="1" color="#000042"> Payment by:</font></td> <td class="table-inquire" width="51%" colspan="2"> <font color="#400000" face="Verdana"> <select name="payment" size="1"> <option value="VISA">VISA</option> <option value="MASTER">MASTER</option> <option value="CASH">CASH</option> <option value="T/T Banktransfer">T/T Banktransfer</option> <option selected>Please select</option> </select></font><font size="2" color="#400000" face="Verdana"></font></td> </tr> Same counts for the message field. It's gone also.... Can anyone advise please, what I have to specify, in order to keep the message field preserved in this sample: <font face="Verdana" size="2" color="#000042"><br> Further comments:<br></font <font color="#400000" face="Verdana"> <textarea rows="5" name="message" cols="60"></textarea> Any advise greatly appreciated. Thanks.
  9. OOOPS... It's me again: Same counts for the message field. It's gone also.... Can anyone advise please, what I have to specify, in order to keep the message field preserved in this sample: <font face="Verdana" size="2" color="#000042"><br> Further comments:<br></font <font color="#400000" face="Verdana"> <textarea rows="5" name="message" cols="60"></textarea> Thanks again
  10. GREAT this forum - JUST GREAT !... Issue: All data entered into my online form was lost (blanked out) and the form returned correctly with message "wrong verification code", when submitted with the wrong verification code. However, going through this great forum I managed to get all - manually entered - data back ! I placed value="<?php echo $_GET['the_field_name'];?>"/ after each input field. BUT... not so with input fields entered from drop-down menu ! How do I put a similar string for the field "Payment by" in this sample: <tr> <td class="table-inquire" width="47%"> <font face="Verdana" size="1" color="#000042"> Payment by:</font></td> <td class="table-inquire" width="51%" colspan="2"> <font color="#400000" face="Verdana"> <select name="payment" size="1"> <option value="VISA">VISA</option> <option value="MASTER">MASTER</option> <option value="CASH">CASH</option> <option value="T/T Banktransfer">T/T Banktransfer</option> <option selected>Please select</option> </select></font><font size="2" color="#400000" face="Verdana"></font></td> </tr> Any advise greatly appreciated. Thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.