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
https://forums.phpfreaks.com/topic/166902-help-with-get-statement/
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" />

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>';

}

 

 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.