Hi and thanks for reading my question. I'm using a simple form to get some input:
& lt; P & gt; Select your favorite two countries below: & lt; / P & gt; & Lt; Form id = "world" name = "world" action = "/ order.php" method = "post" & gt; & Lt; Input type = "checkbox" name = "country" value = "USA" /> USA & lt; Br / & gt; & Lt; Input type = "checkbox" name = "country" value = "Canada" /> Canada & lt; Br / & gt; & Lt; Input type = "checkbox" name = "country" value = "Japan" /> Japan & lt; Br / & gt; & Lt; Input type = "checkbox" name = "country" value = "china" /> China & lt; Br / & gt; & Lt; Input type = "checkbox" name = "country" value = "France" /> France & lt; Br / & gt; & Lt; Input type = "submit" value = "order" & gt; & Lt; / Form & gt;
I have to make sure that order.php is receiving all the selected options, so order.php is the following code only:
& lt ; Pre & gt; & Lt ;? Php var_dump ($ _ POST) ;? & Gt; & Lt; / Pre & gt; Unfortunately, this is the only weight gain output, the lowest check box that has been checked. The output is as follows:
array (
& lt ;? php foreach (1) {["country"] => String (6) "Canada"} If I try the following code for output: $ key as $ _POST = & gt; $ post_data} {resonant " You posted: "$ key" = "$ post_data" & lt; br & gt; "; }? & Gt;
I get this output:
You posted: countries = Canada
Can anyone tell me where I'm going And how can I retrieve all data, which is marked for every box?
Thank you.
& lt; P & gt; Select your favorite two countries below: & lt; / P & gt; & Lt; Form id = "world" name = "world" action = "/ order.php" method = "post" & gt; & Lt; Input type = "checkbox" name = "country []" value = "USA" /> USA & lt; Br / & gt; & Lt; Input type = "checkbox" name = "country []" value = "Canada" /> Canada & lt; Br / & gt; & Lt; Input type = "checkbox" name = "country []" value = "japan" /> Japan & lt; Br / & gt; & Lt; Input type = "checkbox" name = "country []" value = "china" /> China & lt; Br / & gt; & Lt; Input type = "checkbox" name = "country []" value = "France" /> France & lt; Br / & gt; & Lt; Input type = "submit" value = "order" & gt; & Lt; / Form & gt;
Change it from the top, it will store all your checkbox results for you!
Comments
Post a Comment