how do i use multiple HTTP vars along with internal links?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
radioradio
Forum Newbie
Posts: 1
Joined: Mon Jun 14, 2004 5:00 am

how do i use multiple HTTP vars along with internal links?

Post by radioradio »

i'm working on a dynamic schedule for a radio station and i have two variables passed to the page through the url. one controls whether the schedule lists shows by the show title or the dj and the other controls what genre of show gets highlighted.

right now i have links on the page which allow you to switch around the variables that get sent to the page. like this..

display by <a href="?display=dj">dj names</a> or <a href="?display=title">show titles</a>

and

show shows that are <a href="?genre=rock">rock</a> etc...

but when i click on the genre button to display rock shows i lose the ?display=dj part of the url. how can i keep both variables in the url through internal links?

thanks,

dan
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

echo "<a href=\"?genre=rock&{$_GET['display']}\">rock</a>";
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

Post Reply