go; so no matter w...">

Is there a compatible way to write href?

For example, in the file test.php

:

<a href="someting/?start=1">go</a>;

      

so no matter where this one is test.php

, be it in the directory Document_Root/Test/

or in the directory Document_Root/Production/

, the anchor will point to itself.

+1


a source to share


1 answer


To write a link that only changes the query string, just use

<a href="?foo=bar">whatever</a>

      



So, if you are in http://the/current/url.php

, he goes to http://the/current/url.php?foo=bar

, or if you http://somewhere/else?entire=ly

, he goes to http://somewhere/else?foo=bar

.

+10


a source







All Articles