Have you tried using the built in "CHECKED" attribute? For example, here's a snippet of code that I use for radio buttons (sorry for the formatting) :
if ($default == 1)
{
echo "<INPUT TYPE = \"radio\" NAME = \"AppendNum\" VALUE = \"1\" CHECKED>Do something. <br>";
echo "<INPUT TYPE = \"radio\" NAME = \"AppendNum\" VALUE = \"0\">No, do not do something.<br>";
}
else
{
echo "<INPUT TYPE = \"radio\" NAME = \"AppendNum\" VALUE = \"1\">Do something. <br>";
echo "<INPUT TYPE = \"radio\" NAME = \"AppendNum\" VALUE = \"0\" CHECKED>No, do not do something.<br>";
}
Basically what this does, using the conditional operator (?) is to select the value of $default. IOW, if $default contains a 1, then that radio button will be checked. Otherwise, the other button will be checked.
I hope this is on track to what you are looking for. Note: this scheme can also be used for default selections in list boxes.