XFactordx Posted March 19, 2006 Share Posted March 19, 2006 I'm trying to setup a system with links like [a href=\"http://www.blahblah.com/something.php?p=\" target=\"_blank\"]http://www.blahblah.com/something.php?p=[/a][u]variabletolinkto[/u]I can't figure out how to set this up, and have the variabetolinkto cause the something.php to do something. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/5297-switch-linking/ Share on other sites More sharing options...
keeB Posted March 19, 2006 Share Posted March 19, 2006 [code]<?phpswitch ($_GET['p']) {CASE 'links': include('links.php'); break();CASE default: include('index.php'); break();}[/code] Quote Link to comment https://forums.phpfreaks.com/topic/5297-switch-linking/#findComment-18863 Share on other sites More sharing options...
XFactordx Posted March 19, 2006 Author Share Posted March 19, 2006 I was asking along the lines of, lets say i get a link to index.php?p=feb02 then feb02 would get shot into a query/function or whatever and then do its thing that way. any way to set that up?thanks for the start.side note, feb02 IS NOT concrete, it changes. thats why im asking, i dont want to make new cases every day lol Quote Link to comment https://forums.phpfreaks.com/topic/5297-switch-linking/#findComment-18897 Share on other sites More sharing options...
hitman6003 Posted March 19, 2006 Share Posted March 19, 2006 You should read the manual.Specifically the sections on variables and $_GET variables.[a href=\"http://us2.php.net/manual/en/reserved.variables.php#reserved.variables.get\" target=\"_blank\"]http://us2.php.net/manual/en/reserved.vari...d.variables.get[/a]Essentially any variable that you pass in the url is available through the $_GET array. From there you can use it and manipulate it however you want...for a query, for deciding which page to display, etc. Quote Link to comment https://forums.phpfreaks.com/topic/5297-switch-linking/#findComment-18898 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.