Monday, 24 November 2014

PHP - Image not displayed

Issue

I have problem with my PHP page. The images inserted are not displayed in my browser when I run my the page on my WAMP server. Here is the code: 
<img src="file:///c:/wamp/www/my_super_site/images/my_picture.jpg" width="261" height="95" title="nature" /> 

Solution

The URL must begin with http://localhost/
  • Your site is available at http://localhost/my_super_site/
  • If your page is in the "my_super_site" folder, you can write the path to your image as below:
    • <img src="images/my_picture.jpg" width="261" height="95" title="nature" />
  • Or:
    • <img src="http://localhost/my_super_site/images/my_picture.jpg" width="261" height="95" title="nature" />
  • You should in not use path like : "file:///c:/"
  • You access the apache server via: "http://localhost/"

0 comments:

Post a Comment