1

例如,在文件中test.php

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

这样无论在哪里test.php,无论是在Document_Root/Test/目录中还是在Document_Root/Production/目录中,锚点都会指向自己。

4

1 回答 1

10

要编写一个只会更改查询字符串的链接,只需使用

<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

于 2009-05-17T02:07:19.910 回答