try something like this: $result = $_SERVER['PHP_SELF'] | |
about | |
- THE SCRIPT - | - THE LIST OF VARIABLES AND RESULTS ON THIS SERVER - |
PHP_SELF | /wiki/pmwiki.php |
- filename of the currently executing script | |
SCRIPT_NAME | /wiki/pmwiki.php |
- path of the current script | |
SCRIPT_FILENAME | /home/username-hidden/snippetspub.com/wiki/pmwiki.php |
- absolute pathname of the currently executing script | |
about | |
- THE PAGE - | |
SCRIPT_URI | https://www.snippetspub.com/Site/PathInfo |
- URI of the current page | |
HTTP_REFERER | https://snippetspub.com/Site/PathInfo |
- complete URL of the current page (not reliable because not all user-agents support it) | |
about | |
- THE SERVER - | |
SERVER_ADDR | 173.236.253.66 |
- IP address of the host server | |
SERVER_NAME | www.snippetspub.com |
- name of the host server (such as www.w3schools.com) | |
HTTP_HOST | www.snippetspub.com |
- Host header from the current request | |
SERVER_SOFTWARE | Apache |
- server identification string (such as Apache/2.2.24) | |
SERVER_PROTOCOL | HTTP/2.0 |
- name and revision of the information protocol (such as HTTP/1.1) | |
HTTPS | on |
- Is the script queried through a secure HTTP protocol | |
GATEWAY_INTERFACE | CGI/1.1 |
- version of the Common Gateway Interface (CGI) the server is using | |
REQUEST_URI | /Site/PathInfo |
- request URI of page requesting the page | |
REQUEST_METHOD | GET |
- request method used to access the page (such as POST) | |
SERVER_PORT | 443 |
- port on the server machine being used by the web server for communication (such as 80) | |
REQUEST_TIME | 1735823156 |
- timestamp of the start of the request (such as 1377687496) | |
HTTP_ACCEPT | */* |
- Accept header from the current request | |
QUERY_STRING | n=Site/PathInfo |
- query string if the page is accessed via a query string | |
HTTP_ACCEPT_CHARSET | |
- Accept_Charset header from the current request (such as utf-8,ISO-8859-1) | |
about | |
- THE USER - | - Information about the Browser viewing the page |
REMOTE_ADDR | 18.221.97.20 |
- IP address from where the user is viewing the current page | |
HTTP_CLIENT_IP | |
- Client IP address | |
HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) |
- User Browser: Self-Reported info | |
REMOTE_HOST | |
- Host name from where the user is viewing the current page | |
REMOTE_PORT | 53133 |
- port being used on the user's machine to communicate with the web server | |
SERVER_ADMIN | webmaster@snippetspub.com |
- value given to the SERVER_ADMIN directive in the web server configuration file | |
SERVER_SIGNATURE | |
- server version and virtual host name which are added to server-generated pages | |
PATH_TRANSLATED | |
- file system based path to the current script | |
- F Y I - | Related Global Information |
get_current_user() | username-hidden |
__FILE__ | /home/username-hidden/snippetspub.com/wiki/cookbook/ServerInfo.php |
- Super Global - the original file containg this code regardless of include/include_once | |
__DIR__ | /home/username-hidden/snippetspub.com/wiki/cookbook |
- Super Global - For Comparison: Note how this shows its directory as /cookbook | |
dirname(__DIR__) | /home/username-hidden/snippetspub.com/wiki |
- dirname (Parent) of PHP magic constant |