Re: linking to an image with document_root

From: Date: Fri, 01 Jun 2007 09:21:46 +0000
Subject: Re: linking to an image with document_root
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-255963@lists.php.net to get a copy of this message
blueboy wrote:
May be a stupid question but can I link to images with doscument root there are no stupid questions, only stupid answers.
$img_url= $_SERVER['DOCUMENT_ROOT'].'/images/holder.gif';
no you cant; do this in a script on your server: echo "<pre>"; print_r($_SERVER); and have look at the variables you can make use of, I would imagine $_SERVER[SERVER_NAME] might be the ones you want. clive
echo "<img src=\"$img_url\" width=\"250\" height=\"163\"/>"; I am certain the path is correct, If not what are my alternatives? R.
-- Regards, Clive. Real Time Travel Connections {No electrons were harmed in the creation, transmission or reading of this email. However, many were excited and some may well have enjoyed the experience.}

« previous php.general (#255963) next »