Re: linking to an image with document_root
| From: | zerof | Date: | Fri, 01 Jun 2007 14:21:07 +0000 |
| Subject: | Re: linking to an image with document_root | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-255967@lists.php.net to get a copy of this message | ||
blueboy escreveu:
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\"/>"; I am certain the path is correct, If not what are my alternatives? R. --------------I think the best solution is to set the image path using de define function. @define ("PATHTOIMG", "the_path/", true ); echo '<img src="' . PATHTOIMG . 'image.png" border="0" alt="image.png" title="Image title" />'; -- zerof http://www.educar.pro.br/ Apache - PHP - MySQL - Boolean Logics - Project Management ---------------------------------------------------------- Você deve, sempre, consultar uma segunda opinião! ---------------------------------------------------------- Deixe todos saberem se esta informação foi-lhe útil. ---------------------------------------------------------- You must hear, always, one second opinion! In all cases. ---------------------------------------------------------- Let the people know if this info was useful for you! ----------------------------------------------------------