Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如,在文件中test.php:
test.php
<a href="someting/?start=1">go</a>;
这样无论在哪里test.php,无论是在Document_Root/Test/目录中还是在Document_Root/Production/目录中,锚点都会指向自己。
Document_Root/Test/
Document_Root/Production/
要编写一个只会更改查询字符串的链接,只需使用
<a href="?foo=bar">whatever</a>
因此,如果您在http://the/current/url.php,则转到http://the/current/url.php?foo=bar,或者如果您在http://somewhere/else?entire=ly,则转到http://somewhere/else?foo=bar。
http://the/current/url.php
http://the/current/url.php?foo=bar
http://somewhere/else?entire=ly
http://somewhere/else?foo=bar