954,598 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

cant view images in other browsers ??

hi i just started php, my code works on ie, bit when i open the webpage on firefox and chrome the image does not display?, can anyone help

$car = "C:\wamp\www\porche.jpg";
        
        
        $banner = "<img src=\"$car\" ";
        $banner .= "width=\"380\" height=\"110\" border=\"0\" >"; 
    
        
        echo($banner);
moroccanplaya
Junior Poster
178 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

If you change line 1 to:

$car = "porche.jpg";

it will work. You should never use an absolute path to a windows folder, because once you upload it to a webhost, it will no longer work.

pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 


thanks for that, it works but what if my image files are in another folder what do i do ?? dont i set a path ?

moroccanplaya
Junior Poster
178 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

A relative path, from where your file is to your images, e.g. images/porsche.jpg

pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: