Re: [PHP] linking to an image with document_root
- From: clive@xxxxxxxxxx (clive)
- Date: Fri, 01 Jun 2007 11:21:46 +0200
blueboy wrote:
May be a stupid question but can I link to images with doscument rootthere 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.}
.
- References:
- linking to an image with document_root
- From: "blueboy"
- linking to an image with document_root
- Prev by Date: Re: [PHP] linking to an image with document_root
- Next by Date: Re: php validation form
- Previous by thread: Re: [PHP] linking to an image with document_root
- Next by thread: Re: linking to an image with document_root
- Index(es):
Relevant Pages
|