In the php script below, I got a checkbox ('solstices') and a pair of radiobuttons which happen to be arrays as well. I want them to be active if the checkbox is checked(it works). So if not checked it operates the last query. However I have a problem with operating these radiobuttons. Only the "Winter Solstice" is working right now no matter if I choose the "Summer Solstice". How can I declare their values sufficiently.
HTML:
<tr><td colspan="10" align="center"><h2>Solstices</h2></td></tr>
<tr><td><input name="solstices" type="checkbox" id="solstices" value="1" />Solstices<br /></td></tr>
<td><input name="check_sol[]" type="radio" id="check_sol[]" value="1" />Summer Solstice</td>
<td><input name="check_sol[]" type="radio" id="check_sol[]" value="2" />Winter Solstice<br /></td></tr>
PHP:
//DNI CHECKBOX + ALL
if(isset($_POST['solstices'])){
if(isset($_POST['check_sol'])=='1'){
$tmp="SELECT DISTINCT ".implode(",", $sql_columns)." FROM $database_Database_Test.$table_name where DATE=\"2012-06-11\"";
}
if(isset($_POST['check_sol'])=='2'){
$tmp="SELECT DISTINCT ".implode(",", $sql_columns)." FROM $database_Database_Test.$table_name where DATE= \"2011-12-21\"";
}
}
else {
$tmp ="SELECT DISTINCT ".implode(",", $sql_columns)." FROM $database_Database_Test.$table_name where DATE>=\"$fromdate\" AND DATE<=\"$todate\"";
};