<?php



include 'connect.php';



$state=$_GET['state'];



if($state!='')

{



$state=mysql_real_escape_string($_GET['state']);



$sql=mysql_query("SELECT * from districts where state='$state'") or die(mysql_error());



echo'<div><div id="district">



<option value="" selected="selected">-- Select --</option>';



while($result=mysql_fetch_array($sql))

{



echo'<option value="'.$result['ID'].'">'.$result['district'].'</option>';



}



echo'</div></div>';



}







?>