php - Complicated situation. Getting input name from ajax select dropdown for mysql data -


i have locations dynamic dropdown(country,region,city) done ajax. works great.

my goal retrieve data(posts) mysql table, based on location selections. have posts in mysql table correspond locations.

now issue having query won't retrieve data based on region , city. work $_get country. comes understanding reason because region , city queries in separate php files , called through js code in head section, unable use $_get method inputs.

here form setup.

<form action="" method="get" enctype="multipart/form-data >     <div id="countrydiv">         <select id="country" name="country" onchange="showregion(this.value);">              <option value="0">--select country--</option>              <?php                   $getcountry = db::getinstance()->query("select * countries");                  if(!$getcountry->count()) {                      echo 'no country found!';                  } else {                      foreach($getcountry->results() $row) {                          $country_id     =   escape($row->countryid);                         $country_name   =   escape($row->countryname);                   ?><option value="<?php echo $country_id; ?>" ><?php echo $country_name; ?></option><?php                      }                 }             ?>         </select>     </div>      <div id="regiondiv"></div>      <div id="citydiv"></div>      <input type="submit" value="search">  </form> 

i can country input name above '$_get['country']'. need region , city. how can that?


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -