forked from timschofield/khl-care2x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
findCounty.php
43 lines (39 loc) · 1.4 KB
/
findCounty.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!--//---------------------------------+
// Developed by Roshan Bhattarai |
// http://roshanbh.com.np |
// Contact for custom scripts |
// or implementation help. |
// [email protected] |
//---------------------------------+-->
<?
#### Roshan's Ajax dropdown code with php
#### Copyright reserved to Roshan Bhattarai - [email protected]
#### if you have any problem contact me at http://roshanbh.com.np
#### fell free to visit my blog http://php-ajax-guru.blogspot.com
?>
<?
require('./roots.php');
global $db;
$county=$_GET['county'];
$query="SELECT id,county from care_ug_county WHERE district_id = ".$county;
?>
<select name="county" size="1" id="county" onchange="getSubCounty(this.value)">
<?php
if (isset($_POST['county'])) {
?>
<option value="<?php echo $_POST['county'];?>" ><?php echo $_POST['county'];?></option>
<?php
} else { ?>
<option value="-1" >---select County--------</option>
<?
// lets get all the districts
// $sql = "SELECT id,district_name ";
$result = $db->Execute($query);
while($county = $result->Fetchrow()) {
?>
<option value="<?php echo $county['id'];?>" ><?php echo $county['county'];?></option>
<?php
}
}
?>
</select>