Hi,
I'm trying to display images using the file name appended to the document root using $_SERVER['DOCUMENT_ROOT'], so that i can call an image from any folder throughout the site, without having to worry which folder the page is in (eg if the image is in the folder www/uploads and the script is in the folder www/admin).
The problem i have is that the images are not displaying, although the alt text displays, and right clicking on the image gives the correct filename and path. It doesn't not seem to matter whether i'm using my locally hosted files (for testing) or files on my website.
Here's my code to display an image.
$root = ($_SERVER['DOCUMENT_ROOT']);
<img src="<?php echo $root . $oldname; ?>" alt="<?php echo $alttext; ?>" />
Does anyone have any ideas?
Thanks
Richard.