473,399 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

how to refer absolute path in image src?

Hi
In my php page my i'm displaying a image. The image resides in the same location where the php page resides. when i refer other image src other than in
the document root , it is not working.
/var/www/html is the document root.
My php page and the image resides in var/www/html folder.
I could access it as http://localhost/mypage.php. It displays the image and working fine.
If i refer it from some other folder like /var/imagefolder/, it is not working.

<img src = image1.jpg > ... Works if the php file and image file resides in same path.

<img src = 'file:///var/images/image1.jpg' -- Fails

Please post your replies.

somaskarthic
Aug 24 '06 #1
2 28934
iam_clint
1,208 Expert 1GB
http://www.codeave.com/html/code.asp?u_log=5028

take a look at this link
Aug 24 '06 #2
vssp
268 100+
Try this

<img src = '/var/images/image1.jpg'
its working fine
Aug 24 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: dchaffin | last post by:
I'm having a problem using file_exists with an absolute path and I can not figure out why. I tried the exact example that is on www.php.net ... <?php $filename = '/path/to/foo.txt'; if...
7
by: Wayne | last post by:
I have a script that uses filesystemobject that reads files from a given path, in my case images. It is running on a server that is 2000 adv svr w/ all current patches. The script prior to some...
0
by: Hamster_Huey | last post by:
Hey guys, I've got what i think is a simple problem, yet i can't seem to find a solution. I'd like to place an image in my HTML file whose source is a hard-coded ABSOLUTE path on my harddrive: ...
3
by: John Lewis | last post by:
I hope someone can help with this. I have a website using Access and ASP developed on my own PC (using PWS) and hosted on a commercial site. I decided that splitting the dbase up would be a...
1
by: trihanhcie | last post by:
Hi, I have a <img src = "http:// ..."> which needs to be put in a secured page. For example on amazon when the confirmation page is displayed... The problem is that it's a secured page (https)...
19
by: Jerry M. Gartner | last post by:
Greetings: What is the best way to resolve paths within a document regardless of what path it is opened under? For example: I have x.php and it contains <img src="images...">, (amongst other...
9
by: Pumkin | last post by:
Hello guys, I have a small problem with setting the absolute path of an image. Here is the scenario: I need to put the image in a text concat something like this: <asp:Label id = "lbl"...
2
by: Adam Right | last post by:
Hi All, I'm developping a site using VS2008 (c#) on IIS 6.0. In my application images are not shown by the image control, they are in the web server machine and the main folder path is...
1
by: jagdeep gupta | last post by:
I have used two image tag in one i use relative path but in other absolute the image with absolute pat is not shown. here is code <%@ Page Language="C#" AutoEventWireup="true"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.