Re: linking to an image with document_root

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

 



blueboy wrote:
May be a stupid question but can I link to images with doscument root

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

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

An image source is the URL to that image.

The server document root is the local location of that file (eg /home/user/file.gif) - which is never going to work as a URL.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
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