rooot
Новичок
Переменной не присваивает значение
<?php
$search_region_id=preg_replace("/country_id=/","",$_SERVER['QUERY_STRING']);
$search_region_id=preg_replace("/&page=regioninfo/","",$QUERY_STRING);
$region_id=$_POST['search_region_id'];
?>
<select name="countries" onchange="window.location=this.options[this.selectedIndex].value;" >
<?php
include ('lib/connect.php');
$SQL = "select * from tbl_Country order by CN_NAME";
$rs = mssql_query($SQL, $link);
while ($row = mssql_fetch_row($rs)) {
echo "<option value='index.php?country_id=".$row[0]."&page=regioninfo' selected>".$row[1]."</option>\n";
}
?>
</select>
<select name="regions">
<?php
$SQL = "select * from Resorts where RS_CNKEY='$region_id' order by RS_NAME";
$rs = mssql_query($SQL, $link);
while ($row = mssql_fetch_row($rs)) {
echo "<option value='".$row[0]."'>".$row[2]."</option>";
}
include ('lib/disconnect.php');
?>
</select>
<!--form name="search_form" method="post">
<input type="Hidden" name="search_region_id" value="<?php echo $search_region_id; ?>">
<input type="Hidden" name="page" value="regioninfo">
</form-->
Ни как не могу получить второй селект с регионами по выбранной стране.....Спасибо.
<?php
$search_region_id=preg_replace("/country_id=/","",$_SERVER['QUERY_STRING']);
$search_region_id=preg_replace("/&page=regioninfo/","",$QUERY_STRING);
$region_id=$_POST['search_region_id'];
?>
<select name="countries" onchange="window.location=this.options[this.selectedIndex].value;" >
<?php
include ('lib/connect.php');
$SQL = "select * from tbl_Country order by CN_NAME";
$rs = mssql_query($SQL, $link);
while ($row = mssql_fetch_row($rs)) {
echo "<option value='index.php?country_id=".$row[0]."&page=regioninfo' selected>".$row[1]."</option>\n";
}
?>
</select>
<select name="regions">
<?php
$SQL = "select * from Resorts where RS_CNKEY='$region_id' order by RS_NAME";
$rs = mssql_query($SQL, $link);
while ($row = mssql_fetch_row($rs)) {
echo "<option value='".$row[0]."'>".$row[2]."</option>";
}
include ('lib/disconnect.php');
?>
</select>
<!--form name="search_form" method="post">
<input type="Hidden" name="search_region_id" value="<?php echo $search_region_id; ?>">
<input type="Hidden" name="page" value="regioninfo">
</form-->
Ни как не могу получить второй селект с регионами по выбранной стране.....Спасибо.