Re: linking to an image with document_root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Friday, June 1, 2007, 6:16:34 PM, you wrote:
b> May be a stupid question but can I link to images with doscument root

b> $img_url= $_SERVER['DOCUMENT_ROOT'].'/images/holder.gif';

b> echo "<img src=\"$img_url\" width=\"250\" height=\"163\"/>";

b> I am certain the path is correct,

b> If not what are my alternatives?


b> R. 


You don't need anything other than the first slash and it will be from
the root of the web site. So all you need is:
$url = '/images/holder.gif';

and it will come from http://whatever.com/images/holder.gif

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux