Forum Moderators: coopster

Message Too Old, No Replies

how can I make php fill in RADIO buttons?

         

partha

7:35 pm on Jan 9, 2005 (gmt 0)

10+ Year Member



I need to have a php script fill in some radio buttons based on values from a database. Any idea how this would be possible?

Captaffy

7:51 pm on Jan 9, 2005 (gmt 0)

10+ Year Member



something along the lines of-

if ($value_from_database == "something")
print "<input type='radio' name='search_type' value='submitted' checked='checked' />";
else
print "<input type='radio' name='search_type' value='submitted' />";

OR

<input type='radio' name='search_type' value='submitted' <?php if ($value_from_database == "something") print "checked='checked'";?> />