<?php  
include('../common/connect.php');




$country=$_POST['country'];
$sql=mysql_query("SELECT * FROM `state` WHERE `country` = '$country' ORDER BY `state`.`state` ASC") or die(mysql_error());
echo "<option value=''>SELECT STATE</option>";
while($var=mysql_fetch_array($sql))
{
echo "<option value=$var[ids]>$var[state]</option>";
 }
 
if(isset($_POST['subject']) && !empty($_POST['subject']))
{ 
   $subject=$_POST['subject'];
$sql1=mysql_query("SELECT * FROM `distance_subject` WHERE `semester_id` ='$subject'") or die(mysql_error());
while($var1=mysql_fetch_array($sql1))
{
echo "<option value=$var1[subject_id]>$var1[subject_code] - $var1[subject_name]</option>";
 }
}
?>