create a list of zones
<select name="shipping_zone" id="shipping_zone"> <option value="0">- выберите область -</option> <?php foreach ($zones as $zone) { ?> <?php if(!empty($zone['id_area'])){ ?> <option value="<?php echo $zone['id_area'] ?>" ><?php echo $zone['name']; ?></option> <?php } ?> <?php } ?> </select> after selecting the zone I want to load html via Ajax
$("#shipping_zone").change(function () { var zone = parseInt($("#shipping_zone").val()); console.log(zone); getCodeNovaposhtaCities(zone); }); function getCodeNovaposhtaCities(zone) { var city = $("#shipping_city"); $("#divregion").fadeIn("fast"); city.attr("disabled", false); if(zone > 0){ } city.load( "order_change.tpl", {zone: zone}, ); } but for some reason goes null
public function getCodeNovaposhtaCities(){ $zone = $_POST['zone']; $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "novaposhta_cities` WHERE Area ='". $zone. "'"); //print_r($query);die; return $query->rows; }
getCodeNovaposhtaCities- Igor" . DB_PREFIX . "novaposhta_citiesWHERE Area = '". $ zone. "'"); // print_r ($ query); die; return $ query-> rows; } $ zone = NULL That should come from the selection of a region, - Roman Yushko105; DROP TABLE novaposhta_citiesaccording to getu105; DROP TABLE novaposhta_cities105; DROP TABLE novaposhta_cities? Well, or something more interesting. sqlmap.org This thing can automatically download your entire database and upload something like metasploit.com ... Read aboutSQL injection- E_p