|
||||||
| 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!
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. | Need help? Send a To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. |
| 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 11:00 AM |
| C- Syntax to allocate Global variables to consecutive memory locations | techie82 | C and C++ | 1 | 04-09-2007 11:42 AM |
| Tutorial: Proxy Servers | Lop | Tutorials | 7 | 01-02-2007 03:53 AM |
| game server mod | John | C and C++ | 8 | 08-20-2006 10:01 AM |
| Howto use global variables | dirkfirst | PHP Forum | 4 | 07-15-2006 02:19 PM |
| Xav | ........ | 1276.19 |
| MeTh0Dz|Reb0rn | ........ | 1048.58 |
| marwex89 | ........ | 869.98 |
| John | ........ | 868.39 |
| morefood2001 | ........ | 868.04 |
| WingedPanther | ........ | 761.06 |
| Brandon W | ........ | 684.87 |
| chili5 | ........ | 294.12 |
| Steve.L | ........ | 216.18 |
| dargueta | ........ | 192.86 |
Goal: 100,000 Posts
Complete: 81%