wondering how it is possible to have an anchor which adds a variable to the end of an URL?
So something like /?filter=1 would turn into /?filter=1&p=1
Cheers
EDIT:
If anyone’s interested, I found my own solution in the following format, it’s dynamic and requires no editing! 🙂
//CREATE LINKS BASED ON CURRENT VARIABLES
//REMOVE PARAMETERS WHICH WON'T APPEAR TWICE
$v = array("p");
foreach($v as $i) {unset($_GET[$i]);}
$uri = http_build_query($_GET);
#if there is a current variable, add & to link
$uri .= count($_GET)>0 ? "&" : NULL;
and your links would be formatted as such:
echo "<a href='?".$uri."p=$x'>$x</a>";
You can keep adding parameters to the end of your URLS as you suggest:
These will then be available as
$_GET["one"],$_GET["two"]and$_GET["three"]respectively.