|
||||||
| PHP Tutorials PHP Tutorials |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||||
|
This tutorial will show you how you can use $_SERVER[] variables..
$_SERVER['DOCUMENT_ROOT'] PHP Code:
$_SERVER['GATEWAY_INTERFACE'] PHP Code:
$_SERVER['HTTP_ACCEPT'] PHP Code:
$_SERVER['HTTP_ACCEPT_CHARSET'] PHP Code:
$_SERVER['HTTP_ACCEPT_ENCODING'] PHP Code:
$_SERVER['HTTP_ACCEPT_LANGUAGE'] PHP Code:
$_SERVER['HTTP_CONNECTION'] PHP Code:
$_SERVER['HTTP_HOST'] PHP Code:
$_SERVER['HTTP_REFERER'] PHP Code:
$_SERVER['HTTP_USER_AGENT'] PHP Code:
$_SERVER['PATH_TRANSLATED'] PHP Code:
Note: As of PHP 4.3.2, PATH_TRANSLATED is no longer set implicitly under the Apache 2 SAPI in contrast to the situation in Apache 1, where it's set to the same value as the SCRIPT_FILENAME server variable when it's not populated by Apache. This change was made to comply with the CGI specification that PATH_TRANSLATED should only exist if PATH_INFO is defined. Apache 2 users may use AcceptPathInfo = On inside httpd.conf to define PATH_INFO. $_SERVER['PHP_SELF'] PHP Code:
If PHP is running as a command-line processor this variable contains the script name since PHP 4.3.0. Previously it was not available. $_SERVER['QUERY_STRING'] PHP Code:
$_SERVER['REMOTE_ADDR'] PHP Code:
$_SERVER['REMOTE_PORT'] PHP Code:
$_SERVER['REQUEST_METHOD'] PHP Code:
Note: PHP script is terminated after sending headers (it means after producing any output without output buffering) if the request method was HEAD. $_SERVER['REQUEST_URI'] PHP Code:
$_SERVER['SCRIPT_FILENAME'] PHP Code:
Note: If a script is executed with the CLI, as a relative path, such as file.php or ../file.php, $_SERVER['SCRIPT_FILENAME'] will contain the relative path specified by the user. $_SERVER['SCRIPT_NAME'] PHP Code:
$_SERVER['SERVER_ADMIN'] PHP Code:
$_SERVER['SERVER_NAME'] PHP Code:
$_SERVER['SERVER_PORT'] PHP Code:
$_SERVER['SERVER_PROTOCOL'] PHP Code:
$_SERVER['SERVER_SIGNATURE'] PHP Code:
$_SERVER['SERVER_SOFTWARE'] PHP Code:
Info taken from php.net some of those echo example might not work because some of those variables don't have output!
__________________
|
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Delphi Sockets : Simple client and server program | tosh5457 | Pascal/Delphi | 0 | 05-26-2007 12:00 PM |
| C- Syntax to allocate Global variables to consecutive memory locations | techie82 | C and C++ | 1 | 04-09-2007 12:42 PM |
| Tutorial: Proxy Servers | Lop | Tutorials | 7 | 01-02-2007 04:53 AM |
| game server mod | John | C and C++ | 8 | 08-20-2006 11:01 AM |
| Howto use global variables | dirkfirst | PHP Forum | 4 | 07-15-2006 03:19 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 97%