shortcut href link different query param

Post

Ever wanted to have an anchor link back to the same page but just change a query parameter in the url? Using php to discover the full url and echoing that before your query param may be too tedious?

There is a simple way to link back to the same page but with a different query param, say you are on article.php and you want to use an anchor to point the user to article.php?article_id=2. In the anchor href you only need to put "?article_id=2". This can come in handy to shorten your code a little, get rid of some extra output.

Comments

Leave a comment

November 2026
Sun
Mon
Tue
Wed
Thu
Fri
Sat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Share