$s_model = substr(htmlspecialchars(trim($_POST['model'])), 0, 100);
$s_marka = substr(htmlspecialchars(trim($_POST['marka'])), 0, 100);
echo "marka====".$s_marka."<br>";
echo "model====".$s_model."<br>";
function loadXMLDoc(filename) {
if (window.ActiveXObject) {
xhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
else {
xhttp = new XMLHttpRequest();
}
xhttp.open("GET", filename, false);
try { xhttp.responseType = "msxml-document" } catch (err) { } // Helping IE11
xhttp.send(null);
return xhttp.responseXML;
}
document.addEventListener('DOMContentLoaded', function () {
var xml = loadXMLDoc("xml/db.xml"),
selCity = document.querySelector('#marka'),
selStation = document.querySelector('#model'),
i;
[].forEach.call(xml.querySelectorAll('marka'), function (el) {
selCity.add(new Option(el.getAttribute('name'), el.getAttribute('name')))
})
selCity.addEventListener('change', function () {
selStation.options.length = 0 , i=0;
[].forEach.call(xml.querySelectorAll('marka[name=' + this.value + '] > model'), function (el) {
selStation.add(new Option(el.textContent, ++i));
})
})
})