Jump to content

Just need to add variable to URL-can't find clear answer


blesseld

Recommended Posts

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

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.