Kontinent Land Auswahl verbessert Ajax

This commit is contained in:
aschwarz
2024-01-25 10:27:11 +01:00
parent 3282e34713
commit 3097670cab
7 changed files with 96 additions and 334 deletions

38
get_land.php Normal file
View File

@ -0,0 +1,38 @@
<?php
include("aespa/datenbankanbindung.php"); // f&uuml;gt die Datenbankanbindung ein: Sys:\php\includes\kurs\datenbankanbindung.php
$function = $_POST['function'];
if ($function == 'fetch_select') {
$db = dbconnect();
if (isset($_COOKIE['uid1'])) {
$uid1 = $_COOKIE['uid1'];
}
if(isset($_COOKIE['ck_uid1'])){
$uid1 = $_COOKIE['ck_uid1'];
}else{
$uid1 = '';
}
if (isset($_POST['kontinent'])) {
$kid = $_POST['kontinent'];
}
$result1 = $db->query("SELECT land FROM aesp_bewerbung WHERE uid='$uid1'");
$row1 = $result1->fetch_array();
$db = dbconnect();
$query = "SELECT lid, land FROM aesp_land WHERE kid LIKE '$kid' ORDER BY land ASC";
$result = $db->query($query);
while ($row = $result->fetch_array()) {
echo "<option value='$row[lid]'";
if ($row1['land'] == $row['lid']) {
echo " selected ";
}
echo ">" . $row['land'] . "</option>";
}
exit;
}
?>