Jump to content

Flight searcher


Andrew R

Recommended Posts

Hello

I need some help on modifying my flight searcher.  For example, I select Departure airport as “Miami”, arrival airport as “Dublin”, Aircraft as “Airbus A300” and day as “Sunday”.  Once I press submit the form will go to viewroutes.php and display the routes that match the query above. The problem I’m having is the scripts below only allow for one query at a time i.e. I can only display routes on a Monday or any other day.  I believe the problem is in the sql query on the viewroutes.php page.  How would I modify it to allow a query like the one above?

Here are the codes I’m using below.

[code]<form action="viewroutes.php" method="post" name="day" id="day">
  <table width="492" border="0" cellpadding="0" cellspacing="0">
    <!--DWLayoutTable-->
    <tr>
      <td width="133" height="25" valign="middle" bgcolor="#CCCCCC">Departing
        From:</td>
      <td width="359" valign="top"><select name="dep" id="dep">
          <option selected>Dublin</option>
          <option>Shannon</option>
          <option>Miami</option>
        </select>
      </td>
    </tr>
    <tr>
      <td height="24" valign="middle" bgcolor="#CCCCCC">Arrival:</td>
      <td valign="top"><select name="arr" id="arr">
          <option selected>Dublin</option>
          <option>Shannon</option>
          <option>Miami</option>
        </select>
        &nbsp; </td>
    </tr>
    <tr>
      <td height="24" valign="top" bgcolor="#CCCCCC">Aircraft:</td>
      <td valign="top"><select name="aircraft" id="aircraft">
          <option selected>Airbus A300</option>
          <option>Airbus A310</option>
        </select>
      </td>
    </tr>
    <tr>
      <td height="24" valign="top" bgcolor="#CCCCCC">Day:</td>
      <td valign="top"><select name="formquery" id="formquery">
          <option selected>Sunday</option>
          <option>Monday</option>
          <option>Tuesday</option>
          <option>Wednesday</option>
          <option>Thursday</option>
          <option>Friday</option>
          <option>Saturday</option>
        </select>
        <input name="formtype" type="hidden" id="formtype" value="day"> &nbsp;</td>
    </tr>
    <tr>
      <td height="24">&nbsp;</td>
      <td valign="top"><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td>
    </tr>
  </table>
</form>[/code] (search.php)

[code]$query_routes = "SELECT * FROM routes where $formtype like '$formquery'";[/code] (SQL query on viewroutes.php)

Thanks
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.