Server Variables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rayner75
Forum Newbie
Posts: 11
Joined: Sun Feb 20, 2005 4:45 pm

Server Variables

Post by rayner75 »

Hello i am trying to find out how to display some information on my site.
the information is.

Server Host.
Server IP
Server Protocol
Server Software
User's IP Address
Version of PHP used by the server.

so far i have:

<?php
echo "<strong>Server Host:</strong> ". $_SERVER['HTTP_HOST'] . "<br />";
echo "<strong>Server Protocol</strong> ". $_SERVER['SERVER_PROTOCOL'] . "<br />";
echo "<strong>Server Software</strong> ". $_SERVER['SERVER_SOFTWARE'] . "<br />";
echo "<strong>Users IP Address</strong> ". $_SERVER['REMOTE_ADDR'] . "<br />";
?>

not sure which ones to use for IP addy of the server and Version of PHP
used by the server
Any help would be appreciated
Regards
Andy
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Code: Select all

echo $_SERVER&#1111;"SERVER_ADDR"];
echo php_version();
rayner75
Forum Newbie
Posts: 11
Joined: Sun Feb 20, 2005 4:45 pm

Post by rayner75 »

cheers :)
Post Reply