2009-05-17 53 views
1

例如,在文件test.php有沒有兼容的方式來編寫href?

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

,這樣無論在哪裏這個test.php是,無論是在Document_Root/Test/目錄或Document_Root/Production/目錄,錨將指向自身。

回答

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

+0

謝謝,這絕對是我想要的。 – omg 2009-05-17 02:09:55

+3

如果是,請點擊左邊的檢查來接受他的回答 – 2009-05-17 02:17:06

相關問題