<tr><td>Regione</td><td><select name=regione value=$reg><option name=regione>$regione<regione>";
$query=mysql_query("SELECT * FROM regioni");
while($whi=mysql_fetch_row($query)) {
echo"<option name=regione>$whi[1]<regione>";
$reg=$regione;
}
echo"</select><input type=submit value=ok name=prov></td></tr>
<tr><td>Provincia</td><td><select name=provincia><option name=regione>$provincia<regione>";
if ($prov=='ok'){
$query1=mysql_query("SELECT DISTINCT provincia FROM italia WHERE regione='$reg' ORDER BY provincia ");
while($whi1=mysql_fetch_row($query1)) {
echo"<option name=provincia>$whi1[0]<provincia>";
$provi=$provincia;
}
}
echo"</select><input type=submit value=ok name=comu></td></tr>
<tr><td>Comune</td><td><select name=comune>";
if ($comu=='ok'){
$query2=mysql_query("SELECT comuni FROM italia WHERE regione='$regione' AND provincia='$provincia' ORDER BY comuni");
while($whi2=mysql_fetch_row($query2)) {
echo"<option name=comune>$whi2[0]<comune>";
}
}
echo"</select></td></tr></form></table>";