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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.