Adding specific variable to each link?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jmansa
Forum Commoner
Posts: 81
Joined: Wed Aug 23, 2006 4:00 am

Adding specific variable to each link?

Post by jmansa »

I was wandering if there was a way to add a variable to each link on my page without having to hardcode it?

My links could look like this:
mypage.com/index.php?var1=test
mypage.com/index.php?var1=test&var2=123
mypage.com/index.php?var1=test&var2=123&var3=ups


Now what I want is to add a variable at the end of these links like this:

Code: Select all

&app='.$app.'
Can this be done without hardcoding every link on my page (hundreds)?

Thanks in advance :-)
Post Reply