|
Posted by Mark on 07/09/05 15:39
Adrienne wrote:
> Gazing into my crystal ball I observed "Dan Blather" <gimme@shelter.com>
> writing in news:5_Eze.124645$tt5.96061@edtnps90:
>
>
>>Hi,
>>
>>i'm useing 2 servers to host my site, one is a "backup" in case the
>>other fails, or to handle overflow bandwidth.
>>I want to create a little ID tag to implant at the bottom of my home
>>page to let me know which server I am logging in to with my browser.
>>
>>i thought that using php or javascript i could create a simple little
>>"document.write" statment, ID'ing the server that I could call from the
>>bottom of the web-page, either with a simple <script src ...>
>>javascript tag. I tried it with Javascript, but I got a bizarre
>>message "code corrupted. Insert fresh copy" written into the bottom of
>>the web page (which I have NEVER gotten using Javascript before,
>>usually the browser debugger does the reporting!)
>
>
> You actually want server side, not client side, and you want to look at the
> server collection, specifically SERVER_NAME.
>
> <?php echo $_SERVER["SERVER_NAME"] ?>
>
Alternatively, you might add the following SSI statment:
<p style="color: white;">IP: <!--#echo var="SERVER_ADDR" --></p>
This will echo the IP address of the server. I have placed it inside a
white paragraph to sort of hide it (but not very well: you can still
select it and see what it says).
SSI is not necessarily enabled on your server, and usually, though not
always, requires you to change your page's extension from .html to
..shtml to signal to the server that it may need to do something with the
page.
Mark
[Back to original message]
|