Cant get the right radiobox checked
Hello Folks.. I'm trying to get the value from database and according to that value make the radio button checked. Here is my trial code but it doesnt work... function anasayfa_sablon (){ $anasayfasablonu = get_option('anasayfa_sablon'); if ($anasayfasablonu === 'sablon1') { $sablon1 = 'true'; $sablon2 = 'false'; $sablon3 = 'false'; }elseif ($anasayfasablonu === 'sablon2') { $sablon1 = 'false'; $sablon2 = 'true'; $sablon3 = 'false'; }else { $sablon1 = 'false'; $sablon2 = 'false'; $sablon3 = 'true'; } echo "$sablon1, $sablon2, $sablon3"; echo '<p>Birinci Ćablon</p><input type="radio" checked="'.$sablon1.'" id="sablonsecimi1" name="anasayfa_sablon" value="sablon1"> <p>Ä°kinci Ćablon</p><input type="radio" checked="'.$sablon2.'" id="sablonsecimi2" name="anasayfa_sablon" value="sablon2"> <p>ĂĂ§ĂŒncĂŒ Ćablon</p><input type="radio" checked="'.$sablon3.'" id="sablonsecimi3" name="anasayfa_sablon" value="sablon3"> <p>'.$anasayfasablonu.'</p>'; }