Re: [PHP] linking to an image with document_root



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



Relevant Pages

  • Framework Installation & Deployment Confusion
    ... I am new to .NET developmet so please excuse any stupid questions. ... SQL Server on one server, ... is there a specific way that the .Net framework should ... impersonation after adding a specific account to the domain. ...
    (microsoft.public.dotnet.framework.aspnet)
  • ABOUT MONITOR/WATCH FOLDER AND FILEE SIZE
    ... And I want to apologize for my stupid questions. ... mechanism script where a script will monitor/watch a network ... shared directory and when files are added to it from the clients ...
    (alt.os.linux)
  • ABOUT FILE SIZE AND MONITOR/WATCH DIR
    ... And I want to apologize for my stupid questions. ... mechanism script where a script will monitor/watch a network ... shared directory and when files are added to it from the clients ...
    (comp.unix.shell)
  • Re: ABOUT MONITOR/WATCH FOLDER AND FILEE SIZE
    ... > And I want to apologize for my stupid questions. ... > mechanism script where a script will monitor/watch a network ... > shared directory and when files are added to it from the clients ... I had a 'sleep' in ...
    (alt.os.linux)
  • Re: FP2000 and XP server
    ... Have stupid questions, ... Is this the cached temp files at each individual users ... Not able to find any *.web on the web server but did ... The save time hangs ...
    (microsoft.public.frontpage.programming)