I know next to nothing about php.
What I'm trying to do, is get my php to ignore (and not output) the boxes that aren't checked.
Here is my html:
And here is my php:
Here is a link:
http://mnjordan.com/checkboxes.htm
What I would like to see the php generate is - say you selected 4x6 and 5x7, just 4x6 and 5x7 on the page.
Like I said, my knowledge of php is non-existant. Please don't flame me if I've done something incredibly dumb.
Thanks!
What I'm trying to do, is get my php to ignore (and not output) the boxes that aren't checked.
Here is my html:
HTML:
<form action="checkboxes.php" method="post">
<img src="http://mnjordan.com/images/doggie.jpg">
<h3>DD_01</h3>
<br>
<input type="checkbox" name="4x6"<?php if($4x6 == "on"){echo" CHECKED";}?>4x6
<input type="checkbox" name="5x5"<?php if($5x5 == "on"){echo" CHECKED";}?>5x5
<input type="checkbox" name="5x7"<?php if($5x7 == "on"){echo" CHECKED";}?>5x7
<input type="checkbox" name="8x10"<?php if($8x10 == "on"){echo" CHECKED";}?>8x10
<br>
<input type="checkbox" name="8x12"<?php if($8x12 == "on"){echo" CHECKED";}?>8x12
<input type="checkbox" name="10x10"<?php if($10x10 == "on"){echo" CHECKED";}?>10x10
<input type="checkbox" name="11x14"<?php if($11x14 == "on"){echo" CHECKED";}?>11x14
<input type="checkbox" name="12x18"<?php if($12x18 == "on"){echo" CHECKED";}?>12x18
<br>
<input type="checkbox" name="16x20"<?php if($16x20 == "on"){echo" CHECKED";}?>16x20
<input type="checkbox" name="8_Wal"<?php if($8_Wal == "on"){echo" CHECKED";}?>8 wallets
<input type="checkbox" name="24_Wal"<?php if($24_Wal == "on"){echo" CHECKED";}?>24 wallets
<br>
<input type="submit" name="submit" value="Submit">
</form>
And here is my php:
PHP:
<?php if (condition) {echo $_POST["4x6"];} ?>4x6
<br><?php if (condition) {echo $_POST["5x5"];} ?>5x5
<br><?php if (condition) {echo $_POST["5x7"];} ?>5x7
<br><?php if (condition) {echo $_POST["8x10"];} ?>8x10
<br><?php if (condition) {echo $_POST["8x12"];} ?>8x12
<br><?php if (condition) {echo $_POST["10x10"];} ?>10x10
<br><?php if (condition) {echo $_POST["11x14"];} ?>11x14
<br><?php if (condition) {echo $_POST["12x18"];} ?>12x18
<br><?php if (condition) {echo $_POST["16x20"];} ?>16x20
<br><?php if (condition) {echo $_POST["8_Wal"];} ?>8_Wal
<br><?php if (condition) {echo $_POST["24_Wal"];} ?>24_Wal
Here is a link:
http://mnjordan.com/checkboxes.htm
What I would like to see the php generate is - say you selected 4x6 and 5x7, just 4x6 and 5x7 on the page.
Like I said, my knowledge of php is non-existant. Please don't flame me if I've done something incredibly dumb.
Thanks!