Jump to content

Help with GET statement


flynryan692

Recommended Posts

I'm a bit of a n00b and the script I'm using is not 100% mine. It looks for stuff, like a booking script. When I pick a city the url changes from ?page=flights to ?from=Atlanta&#to "to" being the destination city. Well my site has a get statement on the index as you can see so ?page=flights is in the content folder as flights.php. I know in order for this to work it should say flights.php?from=Atlanta&#to in order to work, how would I change the get function in the script to work? Below is the get function in the script (i think thats it)..

 

<? if ($from == ''){

 

 

 

 

Link to comment
Share on other sites

We'll need the whole script, that line tells us nothing.

 

You would want it to go to ?page=flights&from=Atlanta#to. If you select the city using a dropdown box, it most likely uses a form with the method GET, in which case all you would need to do is add a hidden input element to that form like so:

 

<input type="hidden" name="page" value="flights" />

Link to comment
Share on other sites

Thanks for the reply, here is the entire script for that part.

 

<? if ($from == ''){

 

echo '<option value="">Please Select a City or Airport</option>';

}

?>

                      <?php

do { 

?>

                      <? if ($from == ''){

echo '<option value="?from='.$row_dep['dep_icao'].'&#to">'.$row_dep['dep_city'].'</option>';

}

else {

echo '<option value="?from='.$row_dep['dep_icao'].'&#to">'.$row_dep['dep_city'].'</option>';

}

 

 

?>

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.