Re: Slash problem in link

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx> wrote in message news:200403210751.03147.dxdad27@xxxxxxxxxxxxxx
  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.

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux