你好我想箱子一個網站使用PHP,以及結構如下所示:如何爲我的網站使用php創建絕對網址?
-index.php
-header.php
-footer.php
-style.css
-images\{images are in this folder}
-\web\index.php
-\contact\index.php
事情是我使用PHP的包括所有的index.php文件使用的header.php功能和footer.php文件,但問題是隻有在根文件夾中的index.php顯示樣式,但是當我打開本地主機/網絡/ index.php頁面看起來壞了,因爲沒有找到CSS和圖像。
我該如何解決這個問題。
請幫助
確保使用絕對網址包括CSS,圖像和js。 – anubhava 2012-02-08 07:01:58
你能告訴我如何使用絕對路徑 – srisar 2012-02-08 09:06:42
使用靜態文件的完整路徑例如:而不是'images/abc.gif'使用'/ images/abc.gif' – anubhava 2012-02-08 09:10:53