Hi
I need help displaying certain server variables
below is my code
<?php
error_reporting(0); // turn error messages off
echo "<b>AUTH_TYPE</b>: When running under Apache as module doing HTTP authenticated, this variable holds the authentication type."; // prints definition of AUTH_TYPE
echo "<br><br>";
echo $_SERVER['AUTH_TYPE']; // prints the server variable AUTH_TYPE
echo "<br><br>";
echo "<b>DOCUMENT_ROOT</b>: The document root directory under which the script is executing, as defined in the server's configuration file."; // prints definition of DOCUMENT_ROOT
echo "<br><br>";
echo $_SERVER['DOCUMENT_ROOT']; // prints the server variable DOCUMENT_ROTT
echo "<br><br>";
echo "<b>GATEWAY_INTERFACE</b>: What revision of the CGI specification the server is using; such as 'CGI/1.1'."; // prints definition of GATEWAY_INTERFACE
echo "<br><br>";
echo $_SERVER['GATEWAY_INTERFACE']; // prints the server variable GATEWAY_INTERFACE
echo "<br><br>";
echo "<b>PATH_TRANSLATED</b>: File system-based path to the current script."; // prints definition of PATH_TRANSLATED
echo "<br><br>";
echo $_SERVER['PATH_TRANSLATED']; // prints the server variable PATH_TRANSLATED
echo "<br><br>";
echo "<b>PHP_AUTH_PW</b>: When running under Apache as module doing HTTP authentication, this variable holds the password provided by the user."; // prints definition of PHP_AUTH_PW
echo "<br><br>";
echo $_SERVER['PHP_AUTH_PW']; // prints the server variable PHP_AUTH_PW
echo "<br><br>";
echo "<b>PHP_AUTH_USER</b>: When running under Apache as module doing HTTP authentication, this variable holds the username provided by the user."; // prints definition of PHP_AUTH_USER
echo "<br><br>";
echo $_SERVER['PHP_AUTH_USER']; // prints the server variable PHP_AUTH_USER
echo "<br><br>";
echo "<b>PHP_SELF</b>: The filename of the currently executing script, relative to the document root."; // prints definition of PHP_SELF
echo "<br><br>";
echo $_SERVER['PHP_SELF']; // prints the server variable PHP_SELF
echo "<br><br>";
echo "<b>QUERY_STRING</b>: The query string, if there was any, with which the page was accessed."; // prints definition of QUERY_STRING
echo "<br><br>";
echo $_SERVER['QUERY_STRING']; // prints the server variable QUERY_STRING
echo "<br><br>";
echo "<b>REMOTE_ADDR</b>: The IP address from which the user is viewing the current page."; // prints definition of REMOTE_ADDR
echo "<br><br>";
echo $_SERVER['REMOTE_ADDR']; // prints the server variable REMOTE_ADDR
echo "<br><br>";
echo "<b>REMOTE_HOST</b>: The Host name from which the user is viewing the current page."; // prints definition of REMOTE_HOST
echo "<br><br>";
echo $_SERVER['REMOTE_HOST']; // prints the server variable REMOTE_HOST
echo "<br><br>";
echo "<b>REMOTE_PORT</b>: The port being used on the user's machine to communicate with the Web server."; // prints definition of REMOTE_PORT
echo "<br><br>";
echo $_SERVER['REMOTE_PORT']; // prints the server variable REMOTE_PORT
echo "<br><br>";
echo "<b>REQUEST_METHOD</b>: Specifies which request method was used to access the page; such as 'GET', 'HEAD', 'POST', 'PUT'."; // prints definition of REQUEST_METHOD
echo "<br><br>";
echo $_SERVER['REQUEST_METHOD']; // prints the server variable REQUEST_METHOD
echo "<br><br>";
echo "<b>REQUEST_URI</b>: The URI which was given in order to access this page, such as '/index.html'."; // prints definition of REQUEST_URI
echo "<br><br>";
echo $_SERVER['REQUEST_URI']; // prints the server variable REQUEST_URI
echo "<br><br>";
echo "<b>SCRIPT_FILENAME</b>: The abosolute pathname of the currently executing script."; // prints definition of SCRIPT_FILENAME
echo "<br><br>";
echo $_SERVER['SCRIPT_FILENAME']; // prints the server variable SCRIPT_FILENAME
echo "<br><br>";
echo "<b>SCRIPT_NAME</b>: Contains the current script's path. This is useful for pages that need to point to themselves."; // prints definition of SCRIPT_NAME
echo "<br><br>";
echo $_SERVER['SCRIPT_NAME']; // prints the server variable SCRIPT_NAME
echo "<br><br>";
echo "<b>SERVER_ADMIN</b>: The value given to the SERVER_ADMIN (for apache) directive in the Web server configuration file."; // prints definition of SERVER_ADMIN
echo "<br><br>";
echo $_SERVER['SERVER_ADMIN']; // prints the server variable SERVER_ADMIN
echo "<br><br>";
echo "<b>SERVER_NAME</b>: The name of the server host under which the script is executing."; // prints definition of SERVER_NAME
echo "<br><br>";
echo $_SERVER['SERVER_NAME']; // prints the server variable SERVER_NAME
echo "<br><br>";
echo "<b>SERVER_PORT</b>: The port on the server machine being used by the web server for communication. By default setup, this is '80'."; // prints definition of SERVER_PORT
echo "<br><br>";
echo $_SERVER['SERVER_PORT']; // prints the server variable SERVER_PORT
echo "<br><br>";
echo "<b>SERVER_PROTOCOL</b>: Name and revision of the information protocol via which the page was requested; such as 'HTTP / 1.0'."; // prints definition of SERVER_PROTOCOL
echo "<br><br>";
echo $_SERVER['SERVER_PROTOCOL']; // prints the server variable SERVER_PROTOCOL
echo "<br><br>";
echo "<b>SERVER_SIGNATURE</b>: String containing ther server version and virtual host name, which are added to server-generated pages."; // prints definition of SERVER_SIGNATURE
echo "<br><br>";
echo $_SERVER['SERVER_SIGNATURE']; // prints the server variable SERVER_SIGNATURE
echo "<br><br>";
echo "<b>SERVER_SOFTWARE</b>: The server identification string."; // prints definition of SERVER_SOFTWARE
echo "<br><br>";
echo $_SERVER['SERVER_SOFTWARE']; // prints the server variable SERVER_SOFTWARE
?>
Below is the output:
AUTH_TYPE: When running under Apache as module doing HTTP authenticated, this variable holds the authentication type.
DOCUMENT_ROOT: The document root directory under which the script is executing, as defined in the server's configuration file.
C:/wamp/www/
GATEWAY_INTERFACE: What revision of the CGI specification the server is using; such as 'CGI/1.1'.
CGI/1.1
PATH_TRANSLATED: File system-based path to the current script.
PHP_AUTH_PW: When running under Apache as module doing HTTP authentication, this variable holds the password provided by the user.
PHP_AUTH_USER: When running under Apache as module doing HTTP authentication, this variable holds the username provided by the user.
PHP_SELF: The filename of the currently executing script, relative to the document root.
/server.php
QUERY_STRING: The query string, if there was any, with which the page was accessed.
REMOTE_ADDR: The IP address from which the user is viewing the current page.
127.0.0.1
REMOTE_HOST: The Host name from which the user is viewing the current page.
REMOTE_PORT: The port being used on the user's machine to communicate with the Web server.
51176
REQUEST_METHOD: Specifies which request method was used to access the page; such as 'GET', 'HEAD', 'POST', 'PUT'.
GET
REQUEST_URI: The URI which was given in order to access this page, such as '/index.html'.
/server.php
SCRIPT_FILENAME: The abosolute pathname of the currently executing script.
C:/wamp/www/server.php
SCRIPT_NAME: Contains the current script's path. This is useful for pages that need to point to themselves.
/server.php
SERVER_ADMIN: The value given to the SERVER_ADMIN (for apache) directive in the Web server configuration file.
admin@localhost
SERVER_NAME: The name of the server host under which the script is executing.
localhost
SERVER_PORT: The port on the server machine being used by the web server for communication. By default setup, this is '80'.
80
SERVER_PROTOCOL: Name and revision of the information protocol via which the page was requested; such as 'HTTP / 1.0'.
HTTP/1.1
SERVER_SIGNATURE: String containing ther server version and virtual host name, which are added to server-generated pages.
SERVER_SOFTWARE: The server identification string.
Apache/2.2.17 (Win32) PHP/5.3.5
As you can see its prints all the server variables except, AUTH_TYPE, PATH_TRANSLATED, PHP_AUTH_PW, PHP_AUTH_USER, QUERY_STRING, REMOTE_HOST, SERVER_SIGNATURE.
If I turn error reporting on, I get an undefined index error for these variables
I need help to display these variables
Any assitance will be appreciated
Thanks