2014-01-23 30 views
1
不顯示

笨的我的圖像文件夾的根目錄如下形象笨

/applications/ 
/system/ 
/images/ 

我使用下面的代碼來顯示圖像

<img src="<?php echo base_url('images/my_image.jpg'); ?>"> 

我得到圖像的正確位置在img src的HTML標記中, 但不顯示圖像。

我錯過了嗎?您的寶貴意見非常感謝。

+0

可能是權限問題。 –

+0

可以請你解釋.. Iam使用運行在本地主機上的wamp服務器 – Tom

+0

你可以在瀏覽器中打開該圖像嗎?只需通過螢幕複製圖像的src路徑,並粘貼到網址欄。 –

回答

3

檢查你的htaccess file.Whether它使圖像在webpage.Here加載我會把工作的htaccess file.Try吧..

DirectoryIndex index.php 
RewriteEngine on 
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA] 
+0

完美答案。您必須在存儲圖像的位置添加文件夾名稱。 –