Jump to content


Photo

Image function not working on localhost?


  • Please log in to reply
2 replies to this topic

#1 chinagreenelvis

chinagreenelvis
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 28 October 2006 - 12:14 AM

I have the following url

http://www.chinagree...php?img=man.gif

As you can see, on the internet, it displays correctly. But when I have the same url

http://localhost/tes...php?img=man.gif

the image does not display for me. All I get is an image placeholder. Does anyone have any idea why this happens?

#2 gmwebs

gmwebs
  • Members
  • PipPipPip
  • Advanced Member
  • 174 posts
  • LocationLondon

Posted 28 October 2006 - 10:18 AM

It is most likely because the path to the image is wrong. Try taking out the leading / on your localhost. Also, it would help if you posted the code you are using.

#3 chinagreenelvis

chinagreenelvis
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 29 October 2006 - 09:51 PM

The section of the page that contains the image has the following code

src="/test/<?php echo $img; ?>"

When I view the page source online I get the proper result:

src="/test/man.gif"

But when I view the page source from my localhost folder, I see

src="/test/"






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users