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);

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.