tags:

views:

29

answers:

2

Hi all, Working with PHP. I want to display the images which are in xampp folder not in htdocs (which will be root of the website). How to go about it? I have tried <img src="../../image.jpg", and also tried with src=/image.jpg, not working. Given the total path as src="E:/xampp/image.jpg" still not working. What may be wrong. The file is .php

A: 

You can't access pictures (or files) outside of htdocs on a webpage.

There are probably ways to retrieve the image from a directory "lower" than htdocs with PHP (depending on your open_basedir-restrictions), store them somewhere else and let the img-tag display them or really mess with your server settings to allow access ... but why don't you just place the images somewhere in htdocs (or a subdirectory), where they belong?

Select0r
A: 

You cant access images/css sheets etc outside htdocs folder Make a folder for images in htdocs and use those

kantu