[NOTE: I originally posted this on the JS section, thinking it would be a better solution, but been told it would be better to do it server side]
Hi all,
Well, actually my question isn’t really “How to do”, but “How to do it easier”…
What I want :
– A link on every page of my site that should define a GET variable. By clicking on that link from this page, we’d get the following page :
[code] index.php >> index.php?var=1
index.php?a=b >> index.php?a=b&var=1
index.php?var=2&a=b >> index.php?var=1&a=b
– The variable should then be transmitted from page to page each time I click a link on any page. So, if I click on a link to “main.php” from this page, I’d get the following page :
[code] index.php >> main.php
index.php?a=b >> main.php
index.php?var=2&a=b >> main.php?var=2
I know it can be done by :
– Using 10’s of lines of code that will get the URL, look for ? and &… , and replace depending on what it find… etc.
– Modify each single A HREF by links generated with PHP.
But I am sure there’s a simplier way that I just don’t now…
Thanks for any help ?
Simo