Current page url
-
Hi,
i’m writing a widget. This widget is supposed to have a link which changes it’s state.
e.g. the month to show in a calandar.
In the long run I plan to something with ajax but in the short run I’m looking for a simple solution.
For that I want do assemble a link to the current page and replace a previous version of the parameter by the new.
Assuming I wan’t to add myvalue=10 the current page should generate the link:
http://myblog/2011/03/15/blabla/ -> http://myblog/2011/03/15/blabla/?myvalue=10
http://myblog/2011/03/15/blabla/?foo=bar -> http://myblog/2011/03/15/blabla/?foo=bar&myvalue=10
http://myblog/2011/03/15/blabla/?foo=bar&myvalue=4 -> http://myblog/2011/03/15/blabla/?foo=bar&myvalue=10Can anyone tell me how to do it?
I’m especially failing to find a way to get the complete current url including all parameters. But also I do not yet see how to change every but parameter.thanks a lot
The topic ‘Current page url’ is closed to new replies.