The general idea is this: In order to prevent the previous page from refreshing, I used an iframe to sneak into a secondary sub-page to read the data in the database, and finally pass the desired data to the parent page to complete the selection and transfer of data.
The main program code is as follows (part of the code has been changed, but it does not affect the function):
Parent page reg.html:
Sub-page city.php:
< select name="city" onchange="parent.document.getElementById('city').value=this.value">
< ?php
if(!empty($_GET[”sh_id”])){
//echo “ok”;
$sql=”select * from city where sh_id=”.$_GET[” sh_id"]." order by city_id asc";
$result=mysql_query($sql);
while($row=mysql_fetch_assoc($result)){
?>
}
}
?>