ilhan ilhan - 2 months ago 10
HTML Question

How to add url parameter to the current url?

Currently I'm at

http://example.com/topic.php?id=14
and I want to make a link to
http://example.com/topic.php?id=14&like=like
by not defining the current url. Like
<a href="&like=like">Like</a>
. However this last one shows me
http://example.com/&like=like

Answer

There is no way to write a relative URI that preserves the existing query string while adding additional parameters to it.

You have to:

topic.php?id=14&like=like