I've been wondering this for a while since I started PHP. Some sites use filtering options. Sometimes some of those filters are completely random. For example someone might be viewing: products.php?c=1&p=1&s=100
In that example, let's assume c
is the category, p
is the page and s
is the start price.
If the viewing user were to change the start price or flip to the next page using a hyperlink, how would one change only a single $_GET[]
variable while leaving the others untouched. I do have a small script in PHP to obtain the current URI however, I just can't figure out how I'd change only that variable while keeping the others untouched and refresh the page? I've looked at substr()
, strpos()
, and ereg_replace()
and I just can't figure it out!
I am really sorry if this is a dumb question, I feel like I've missed something really easy that can fix this but I'm genuinely stuck guys.
Thanks so much in advance! Mike.