Iki Posted July 8, 2009 Share Posted July 8, 2009 URL's to some pages on my site pass a variable, like this: http://www.mysite.com/games.php?type=scifi On any of those game pages there could be more than 1 post. I'd like to mark them using href anchors so I can link directly to a certain post. I've got a unique identifier for each post that I can use for this purpose. What I want to know is, how do I pass the anchor identifier (say, #123abc ) while also passing the "type" variable (say, type=scifi )? Thanks in advance for any help! Iki Link to comment https://forums.phpfreaks.com/topic/165174-solved-passing-variable-and-an-href-target-in-the-url/ Share on other sites More sharing options...
Philip Posted July 8, 2009 Share Posted July 8, 2009 script.php?id=123&blah=trgd#test worked for me Link to comment https://forums.phpfreaks.com/topic/165174-solved-passing-variable-and-an-href-target-in-the-url/#findComment-870940 Share on other sites More sharing options...
Iki Posted July 8, 2009 Author Share Posted July 8, 2009 I'm sorry, I don't understand what "id=123" or "&blah=trgd" is? It's games.php?type=scifi and then what? Link to comment https://forums.phpfreaks.com/topic/165174-solved-passing-variable-and-an-href-target-in-the-url/#findComment-871040 Share on other sites More sharing options...
cunoodle2 Posted July 8, 2009 Share Posted July 8, 2009 What the king (of php not pop) was just giving you an example. You can set up your links like this... http://www.mysite.com/games.php?type=scifi&anchor=#123abc Then on the "games.php" page you could do the following... <?php $type = $_GET['type']; $anchor = $_GET['anchor']; //then later use these variables in your page to search or whatever it was you were trying to do with them. ?> Link to comment https://forums.phpfreaks.com/topic/165174-solved-passing-variable-and-an-href-target-in-the-url/#findComment-871049 Share on other sites More sharing options...
thebadbad Posted July 8, 2009 Share Posted July 8, 2009 I'm sorry, I don't understand what "id=123" or "&blah=trgd" is? It's games.php?type=scifi and then what? games.php?type=scifi#123abc Link to comment https://forums.phpfreaks.com/topic/165174-solved-passing-variable-and-an-href-target-in-the-url/#findComment-871054 Share on other sites More sharing options...
Iki Posted July 8, 2009 Author Share Posted July 8, 2009 I'm sorry, I don't understand what "id=123" or "&blah=trgd" is? It's games.php?type=scifi and then what? games.php?type=scifi#123abc Perfect, thank you! I should have gone more into what I was trying to do. I will do that next time. Link to comment https://forums.phpfreaks.com/topic/165174-solved-passing-variable-and-an-href-target-in-the-url/#findComment-871072 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.