blesseld Posted August 18, 2009 Share Posted August 18, 2009 Hey All, I believe what i am trying to do is very simple, but no where actually explains the first part. All i would like to do is add a variable to my URL. I have a file that sets all the page id's for all the pages on my site. and gets included on all pages. how can i get it to show up at the end of my URL? here is a chunk of my file that sets the variables <?php switch ($sheet_name) { case 'homepage': { $page_id = "1"; $current_link = "home"; $dir_listing = "false"; $title ="title"; $meta_desc = "description"; $meta_key = "keywords"; break; } ?> I am tryng to get http://www.domain.com?page_id=1 thanks Quote Link to comment Share on other sites More sharing options...
fooDigi Posted August 18, 2009 Share Posted August 18, 2009 could it be just this? ... http://www.domain.com?page_id=<?php echo $page_id ?> Quote Link to comment Share on other sites More sharing options...
blesseld Posted August 18, 2009 Author Share Posted August 18, 2009 Yes, that works, thankyou, However, is there a way i can toss it in the URL without having to add the echo to all of my links? Like some kinda script I can place in my variables file to auto toss it in the url? this is more what im after, shoulda been more clear. Quote Link to comment Share on other sites More sharing options...
mikesta707 Posted August 18, 2009 Share Posted August 18, 2009 Don't believe there is a way to set a get variable without explicitly setting them in the links themselves. Especially if each one is going to be different depending on which link you set. The only way I see making creating the links easier is if you store your get values in an array, and create the links by iterating through the array. 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.