First things first:
You're talking about using Javascript when you say you want the drop down menus to depend on the one selected prior to it. That is if they are on the same page.
Now, if you want to do it one page at a time, that can be done in php easy.
First, have each one named specifically.
ie the drop down menus are "Vehicle_Type ", "Manufacturer", and "Model"
then the only special thing you have to do is test to see which ones you have and construct the right page according to that like this:
PHP Code:
if(!$Vehicle_Type && !$Manufacturer && !$Model) {
// no selection made yet, give them a choice of vehicle type
$sql = "SELECT Vehicle_Type FROM vehicles";
$result = mysql_db_query($db, $sql, $cid);
echo("<select name=\"Vehicle_Type\">";
while ( $row=mysql_fetch_row($results)
echo("<option value=$row[0]>$row[0]</option>";
}
echo('</select>');
}elseif($Vehicle_Type && !$Manufacturer && !$Model) {
// they've chosen a vehicle type - make a menu based on the types of vechicles
$sql = "SELECT Manufacturer FROM vehicles WHERE Vehicle_Type = $Vehicle_Type";
$result = mysql_db_query($db, $sql, $cid);
echo("<select name=\"Manufacturer\">";
while ( $row=mysql_fetch_row($results)
echo("<option value=$row[0]>$row[0]</option>";
}
echo('</select>');
}elseif($Vehicle_Type && $Manufacturer && !$Model) {
// they chose a vehicle type and manufacture
$sql = "SELECT Model FROM vehicles WHERE Vehicle_Type = $Vehicle_Type and Manufacturer = $Manufacturer";
$result = mysql_db_query($db, $sql, $cid);
echo("<select name=\"Model\">";
while ( $row=mysql_fetch_row($results)
echo("<option value=$row[0]>$row[0]</option>";
}
echo('</select>');
}elseif($Vehicle_Type && $Manufacturer && $Model) {
// they have chose all the nessecary fields
$sql = "SELECT * FROM vehicles WHERE Vehicle_Type = $Vehicle_Type and Manufacturer = $Manufacturer and Model = $Model;";
} else {
// this shouldn't happen, but if it does it's very bad...
}
Also, go read this forum about making urls search engine friendly....this could make for a very nice addition to your system:
Bookmarks