<form>
<?php
$stylesheet = array("style_default.css" => "Default", "style_red.css" => "Red");
foreach($stylesheet as $key => $value)
{
echo '<input type="radio" name="style" value="'.$key.'" checked="';
if($css == $key){echo 'yes';} else{echo 'no';}
echo '" /> '.$value.'<br />';
}
?>
<input type="submit" name="style_change" value="Spara inställningar" />
</form>
Here is the code I use to create radio-buttons. On my database I have a table that saves the value of the radio-buttons. I got visual proof on the page that the the path is correct and I have also checked so $css gives the right value with the help of echo. The value I have is "style_default.css", but I only get the button for red selected. Anyone who knows where all this went wrong?