Re: Slash problem in link

From: Date: Sun, 21 Mar 2004 21:11:03 +0000
Subject: Re: Slash problem in link
References: 1 2  Groups: php.windows 
Request: Send a blank email to php-windows+get-23209@lists.php.net to get a copy of this message
I think its better to have the image folder in the root directory eg www.website.com/image and then have the code as <img src="/image/website.png" />. That way, it would be able to access the image from anyway in your web site...(I Think) "Paul Brownsea" <dxdad27@yahoo.co.uk> wrote in message news:200403210751.03147.dxdad27@yahoo.co.uk... On Sunday 21 March 2004 05:33, Harpreet wrote: > I am having a weird problem. I am not sure if this is a php problme or > plain html problme but see if anyone can help. > > I have a page called login.php. It has the following image link. It works > at home fine when i put the link as below > > <IMG src="images/onlylogo.gif"> > > We tried putting the same page on another customer and it wont show. We put > a slash in the front of image and it worked and we can view the image. <IMG > src="/images/onlylogo.gif"> > > But the slash does not work at home on my machine. > > When do we have to use the slash and when not ...how can we tell > > please help With the "/" you are delcaring that the image is in the directory "images", relative to the server root (maybe "c:\program files\apache\htdocs\images\onlylogo.gif" giving a webaddress of "http://www.mywebsite.com/images/onlylogo.gif"). Whereas without the "/" you are declaring that the image is in the "images" directory, relative to the PHP script (or HTML page) (maybe "c:\program files\apache\htdocs\MYWEBSITE\images\onlylogo.gif" giving "http://www.mywebsite.com/MYWEBSITE/images/onlylogo.gif"). So I think it is just a HTML problem.

« previous php.windows (#23209) next »