how to refer absolute path in image src?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • somaskarthic
    New Member
    • Aug 2006
    • 60

    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
  • iam_clint
    Recognized Expert Top Contributor
    • Jul 2006
    • 1207

    #2


    take a look at this link

    Comment

    • vssp
      Contributor
      • Jul 2006
      • 268

      #3
      Try this

      <img src = '/var/images/image1.jpg'
      its working fine

      Comment

      Working...