我的$GET
參數可能是url
與另一個參數(mysite.co/index.php?q=anothersite.co?id=2)
,我需要忽略它們。Htaccess PHP忽略除第一個以外的所有獲取
但即時通過url後迷路他們(mysite.co/index.php?q=anothersite.co)
。
我該如何解決它?不解碼網址。
我的$GET
參數可能是url
與另一個參數(mysite.co/index.php?q=anothersite.co?id=2)
,我需要忽略它們。Htaccess PHP忽略除第一個以外的所有獲取
但即時通過url後迷路他們(mysite.co/index.php?q=anothersite.co)
。
我該如何解決它?不解碼網址。
你必須使用&
,而不是另一個?
這應該工作
mysite.co/index.php?q=anothersite.co&id=2
編輯:
$encoded = encode("http://anothersite.co?id=2");
然後
mysite.co/index.php?q=$encode
我需要有原始的''' anothersite.co' url in my'GET' – user3623906
好的,如果有可能將'mysite.co /'後面的所有內容傳遞給'PHP'變量,但是不要在瀏覽器中顯示它 - 例如'mysite.co/anysite.co ?id = 123' ?? – user3623906
@ user3623906我已經編輯了答案,你必須使用編碼方法,就像谷歌那樣 – user3091574
你需要URL編碼的您在客戶端傳遞給q的參數。 –
URL中的多個GET請求實際上用'&'分隔,例如:'http://example.com/?test = example&test2 = example2' –
沒有其他辦法嗎?我需要沒有編碼網址:( – user3623906