I have a php page called agentadmin.php
in this page there are more function like:
add
edit
and I also make an addlisting part
elseif ($action == "addlisting")
//add a listing to the directory
{
print "<form name=\"addlisting\" action=\"./agentadmin.php?action=add\" method=post>";
//active only if $use_city_state option is turned on
if ($use_city_state == "Y") {
print "<TR><TD> </td><td align=left><B>Seller Location</b></td></tr>";
print "<select name=\"gekozenstate\">";
$result = mysql_query("SELECT state FROM vehicles GROUP BY state ORDER BY state;",$link);
while ($a_row =mysql_fetch_array ($result) )
{
$city = stripslashes($a_row[state]);
print "<option name=\"state\" value=\"$a_row[state]\">$state";
}
print "</select>";
print "<select name=\"city\">";
$resultstate = mysql_query("SELECT state, city FROM vehicles WHERE state = \"$gekozenstate\" GROUP BY city ORDER BY state, city;",$link);
while ($a_row =mysql_fetch_array ($resultcity) )
{
$city = stripslashes($a_row[city]);
print "<option name=\"city\" value=\"$a_row[city]\">$city";
}
print "</select>";
print "<input type=submit></form>";
I have this but that doesn't seem to work
what I'm trying to do with this script is this:
you see 2 listings first you see a list of states
when you select there a state, I want that in the list under the statelist where the list of cities is, that it only display the cities that belongs to the selected state
Already trying to figure this out for weeks
please advice
thanks in advantage
Rene