Newbee question




Hope some one can shed some light on a small problem I have.

I want to dynamically display a logo depending on what domain is pointing at the site.

So at the moment the code is this

define('HTTP_SERVER', '');

I have tried this but it has thrown up errors.


Can this be done or have I just written the code wrong

Thanks in advance :idea:
I have several domains mirroring a virtual server.

So depending on what domain you use to access the site it will display an appropriate logo.

The site is part of a shop, so this line is defining a variable used through out the site

define('HTTP_SERVER', '');

This is why I want it to look at the domain and display etc etc etc ..........

So is this totally wrong or is their just a slight error in the code

The variabel $_SERVER['SERVER_NAME'] refers to the servername which will be the same for each domain pointing to that server

Instead use: $_SERVER['HTTP_HOST']


should do the trick

Use the function phpinfo(); anywhere in your script to see what variables are available in your scripts and what their value is.
You can use $_SERVER['HTTP_HOST'], my point is I don't see why you want to define it as a constant, when it already exists in the Super Global Array!