Hello,
I'm working on a virtual airline timetable. Now the timetable is working very smoothly but the problem is the following: What I need is a search flights page. On this page I want people to look up flights in the database. But I need two dropdown boxes, this is what I've got so far:
-------------------------------------
<?php
include "config.php";
?>
<?php
print "<form name=depairport method=\"POST\" action=\"engine.php\">
<SELECT name=\"naam\" size=1>
<OPTION>Select Airport";
$query="SELECT DISTINCT depairport FROM iberworldva_timetable ORDER BY depairport";
$result = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_object($result))
{
echo '<option value="' . $row->depairport . '">' . $row->depairport . '</option>';
}
print "</SELECT>
<input class=knop type=\"submit\" name=\"add\" value=\"Add\">
</form>";
?>
<?php
print "<form name=arrairport method=\"POST\" action=\"engine.php\">
<SELECT name=\"naam\" size=1>
<OPTION>Select Airport";
$query="SELECT DISTINCT arrairport FROM iberworldva_timetable ORDER BY arrairport";
$result = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_object($result))
{
echo '<option value="' . $row->arrairport . '">' . $row->arrairport . '</option>';
}
print "</SELECT>
<input class=knop type=\"submit\" name=\"add\" value=\"Add\">
</form>";
?>
-------------------------------------
This works well, but how is it possible to show results in the second box after you've picked something from the first box.. I don't know how to explain this but how does it automatically update the second box? I've searched all over the internet and saw some good help sites but I just cannot get it right and it keeps me awake!!
I hope someone is able to help me out with this.
With kind regards,
Bastiaan Klene.