0

I can't make it work:

<img src="file://d:\image.jpg"> - shows image if I follow the path and refresh the page
<img src="file://d:/image.jpg"> - shows image if I follow the path and refresh the page
<img src="file:\\d:/image.jpg"> - shows image if I follow the path and refresh the page
<img src="d:\image.jpg">  - shows image if I follow the path and refresh the page
<img src="d:/image.jpg"> - The address wasn’t understood
<img src="/image.jpg"> - http://localhost:8000/image.jpg 404
<img src="image.jpg"> - http://localhost:8000/image.jpg 404

Non of them shows the image on the page. What do I do, is it possible?

In Chromium everything gets http://localhost:8000/ added at the beginning of address bar.

mevsme
  • 441
  • 5
  • 15
  • This is a very common issue for this initially you must get all the paths by `print_r($_SERVER)` and then set the values in your image paths as `[HTTP_HOST]/image.jpg"` – Kunal Raut Apr 05 '20 at 07:05
  • The files need either to be somewhere under the web root folder (so you can access them directly) or you will need to write some code which will do the reading for you (something like https://stackoverflow.com/questions/1851849/output-an-image-in-php) – Nigel Ren Apr 05 '20 at 07:06

0 Answers0