August 12, 200817 yr I need some help to write an if statement. I have 2 checkboxes with same values but different field name I am wonder how do I write a if statement to compare the two checkbox if the value check are the same then I skip to another page otherwise I keep at the same page. Any help will be appreciated.
August 12, 200817 yr Checkbox values are stored as text, so if you're doing a simple check in a script, you could use: If [table::checkbox1 = table::checkbox2] Go to Layout [layoutname] ... Else ... Do this ...
August 13, 200817 yr is this in reference to PHP? is this a FORM and you want to branch based upon field1=field2? if this is a FORM, do you want to branch after submit, or use an AJAX to display different parts of a page based on the match?
August 13, 200817 yr Author yes it is in reference to a php. What am I trying to do is to compare if the the value ckecked on checkbox are the same as the value checked on checkbox 2. If in case they are the same they should go to page1.php, And if in case they are not equal they should go to another page2.php Any help will be appreciated. thank you
August 29, 200817 yr yes it is in reference to a php. What am I trying to do is to compare if the the value ckecked on checkbox are the same as the value checked on checkbox 2. If in case they are the same they should go to page1.php, And if in case they are not equal they should go to another page2.php Any help will be appreciated. thank you Create a third page and have your form submit to IT. Test for equal and branch as needed. Use 'header()' to redirect to the proper page. WARNING: do not introduce any whitespace into the page (that is not inside the "<?php ... ?>"). Or your header() will not work. PHP will think you have pushed the whitespace to the browser and issue a 'header already sent' message (or something like that!)
Create an account or sign in to comment