-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathajax.php
More file actions
23 lines (17 loc) · 710 Bytes
/
ajax.php
File metadata and controls
23 lines (17 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
include ('includes/config.inc.php');
$voivodeshipId = isset($_POST['voivodeshipId']) ? $_POST['voivodeshipId'] : 0;
$cityId = isset($_POST['cityId']) ? $_POST['cityId'] : 0;
$command = isset($_POST['get']) ? $_POST['get'] : "";
switch ($command) {
case "city":
$result1 = "<option disabled selected>Choose city...</option>";
$statement = "SELECT * FROM cities WHERE voivodeship_id='$voivodeshipId' ORDER BY city;";
$dt = mysqli_query($conn, $statement);
while ($result = mysqli_fetch_array($dt)) {
$result1 .= "<option value=" . $result['city_id'] . ">" . $result['city'] . "</option>";
}
echo $result1;
break;
}
exit(); ?>