check boxes PHP/MySQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vincenzobar
Forum Commoner
Posts: 95
Joined: Wed Nov 02, 2005 9:57 am

check boxes PHP/MySQL

Post 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?
vincenzobar
Forum Commoner
Posts: 95
Joined: Wed Nov 02, 2005 9:57 am

Post by vincenzobar »

nevermind... DUH Radio buttons!!!!

I need to get more sleep!
Post Reply