spfoonnewb Posted October 27, 2006 Share Posted October 27, 2006 How do I make dynamic links that look like this:[code]http://www.domain.com/index.php?page=category/subject[/code]that use an array, or switch statement? Just how do you do that is the real question!?Each category would have to be a different directory, and each subject a different file.. or I need to be able to specify.It would be used to include pages that already exist in off root level directories.It would also need to have a default page, or message; for security reasons. Quote Link to comment Share on other sites More sharing options...
ldsmike88 Posted October 27, 2006 Share Posted October 27, 2006 It sounds like you need one page and on that page have two variables (category and subject). From those to variables you could change the site all you want. The link would look like this though:[code]http://www.domain.com/index.php?page=category&subject=laundry[/code]Hope this helps!Michael Quote Link to comment Share on other sites More sharing options...
redarrow Posted October 27, 2006 Share Posted October 27, 2006 [code]<?phpecho"<a href='http://www.domain.com/index.php?page=$category'>category/a>";echo"<a http://www.domain.com/index.php?subject=$laundry'>subject</a>";?>[/code]Then this ok[code]<?phpif($_GET['page']=="category"){//do somethink}elseif($_GET['subject']=="laundry"){//do some think}else{}?>[/code] Quote Link to comment Share on other sites More sharing options...
spfoonnewb Posted October 27, 2006 Author Share Posted October 27, 2006 I know how to do all those, I was wondering how you make the links "look" like this:(Ive seen it on a few sites..)[code]http://www.domain.com/index.php?page=category/subject[/code] Quote Link to comment Share on other sites More sharing options...
spfoonnewb Posted October 27, 2006 Author Share Posted October 27, 2006 Noone knows? Quote Link to comment 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.