Page 1 of 1

check boxes PHP/MySQL

Posted: Thu Dec 22, 2005 9:45 am
by vincenzobar
hi all again, I re wrote my little app i got from a friend and now it is working unlike in my previous post. however I am adding a lot of goodies to my app and have run into a problem

forms and check boxes... gotta love them

ok here we go

Code: Select all

<br /><b>Visible</b><br />
<font size="1">Do you want to make this Ad visible?</font><br />
<? if($row_rs_edit['visible'] == 'n'){ ?>
<input name="visible" type="checkbox" value="y" checked="checked" /><br />
<? } else { ?>
<input name="visible" type="checkbox" value="y" checked="checked" /> <br />
<? } ?>
this works for what it is but when i uncheck the box and pass a print_r($_POST); on @extract($_POST) it drops the visible key in my array.
usually if checked it has visible=>y

i want my form to auto populate to Y if N and if unchecked value of checkbox = N and not empty like it seems to be doing

I cannot for the life of me figure that statement out.. anyone?

Posted: Thu Dec 22, 2005 10:43 am
by vincenzobar
nevermind... DUH Radio buttons!!!!

I need to get more sleep!