我想創建一個鏈接,改變一個PHP $_GET
變量。例如:更改PHP獲取鏈接?
URL: http://site.com/index&variable=hello&anothervariable=dontchangeme
<a href="variable=world">Click me</a>
(after click)
URL: http://site.com/index&variable=world&anothervariable=dontchangeme
我知道你可以做到這一點,只是更改頁面(href="1.html"
),但我想這樣做同樣的事情,同時保持已經存在的GET變量。
使用window.location並添加必需的字段。我認爲它最好在Javascipt上完成。 –
Duplicate:http://stackoverflow.com/questions/5809774/manipulate-a-url-string-by-adding-get-parameters – Jelmer
您可能需要在.htaccess文件中編寫一些重寫規則 – BnW