我有一些在屏幕上輸出圖像的腳本,間隔爲5秒。 所有圖像位於一個名爲images/easter
的目錄中。 顯示網頁的URL是http://'localhost'/index.php
。我有一個變量:$directory = 'images/easter/
。PHP解析URL圖像目錄
我們希望用戶創建一個新的圖像目錄並上傳圖片(例如images/holiday
)。 新圖像必須在url中進行簡單更改才能顯示。
http://'localhost'/index.php?holiday
我認爲這可以通過PHP中的URL解析完成。但如何編寫腳本?
謝謝先進。
你可以讓你的URL是這樣的http:// 'localhost' 的/指數。 php?q =假期,並使用$ _GET ['q']獲得您的參數ameter –
axact是如何合成的?這將無法正常工作:$ directory ='images /'。((isset($ _ GET ['q'])); with http://localhost/harald/index.php?q = test – Quinox