Skip to content
codingtube

codingtube

Coding and Programming tutorials

  • javascript
  • React
  • ES6
  • React js
  • coding
  • ffmpeg
  • java
  • programming
  • information
  • coding
  • Privacy Policy
  • Twitter trends
  • Age Calculatore
  • Codingtube Community
  • YouTube Tags Generator
  • About
  • Toggle search form

Server Information in php

Posted on November 27, 2021November 27, 2021 By christo No Comments on Server Information in php

The $_SERVER array contains a lot of useful information from the web server

Here is a complete list of the entries in $_SERVER that come from CGI:

Table of Contents

  • PHP_SELF
  • SERVER_SOFTWARE
  • SERVER_NAME
  • GATEWAY_INTERFACE
  • SERVER_PROTOCOL
  • SERVER_PORT
  • REQUEST_METHOD
  • PATH_INFO
  • PATH_TRANSLATED
  • SCRIPT_NAME
  • QUERY_STRING
  • REMOTE_HOST
  • REMOTE_ADDR
  • AUTH_TYPE
  • REMOTE_USER
  • REMOTE_IDENT
  • CONTENT_TYPE
  • CONTENT_LENGTH

PHP_SELF

The name of the current script, relative to the document root

SERVER_SOFTWARE

A string that identifies the server (e.g., “Apache/1.3.33 (Unix) mod_perl/1.26 PHP/ 5.0.4”)

SERVER_NAME

The hostname, DNS alias, or IP address for self-referencing URLs

GATEWAY_INTERFACE

The version of the CGI standard being followed (e.g., “CGI/1.1”)

SERVER_PROTOCOL

The name and revision of the request protocol (e.g., “HTTP/1.1”).

SERVER_PORT

The server port number to which the request was sent (e.g., “80”).

REQUEST_METHOD

The method the client used to fetch the document (e.g., “GET”)

PATH_INFO

Extra path elements given by the client (e.g., /list/users).

PATH_TRANSLATED

The value of PATH_INFO, translated by the server into a filename (e.g., /home/httpd/ htdocs/list/users).

SCRIPT_NAME

The URL path to the current page, which is useful for self-referencing scripts (e.g., /~me/menu.php).

QUERY_STRING

Everything after the ? in the URL (e.g., name=Fred+age=35).

REMOTE_HOST

The hostname of the machine that requested this page (e.g., “dialup-192-168-0-1.example.com (http://dialup-192-168-0-1.example.com)”). If there’s no DNS for the machine, this is blank and REMOTE_ADDR is the only information given

REMOTE_ADDR

A string containing the IP address of the machine that requested this page (e.g., “192.168.0.250”).

AUTH_TYPE

If the page is password-protected, this is the authentication method used to protect the page (e.g., “basic”).

REMOTE_USER

If the page is password-protected, this is the username with which the client authenticated (e.g., “fred”). Note that there’s no way to find out what password was used.

REMOTE_IDENT

If the server is configured to use identd (RFC 931) identification checks, this is the username fetched from the host that made the web request (e.g., “barney”). Do not use this string for authentication purposes, as it is easily spoofed.

CONTENT_TYPE

The content type of the information attached to queries such as PUT and POST (e.g., “x-url-encoded”)

CONTENT_LENGTH

The length of the information attached to queries such as PUT and POST (e.g., “3,952”)

php Tags:php, Server Information in php

Post navigation

Previous Post: The global arrays in php
Next Post: Processing Forms in php

Related Posts

copy in PHP php
if in php php
ob_clean in php php
The global arrays in php php
array_search in PHP php
bindec in PHP php

Leave a Reply Cancel reply

You must be logged in to post a comment.

Recent Posts

  • Affiliate Marketing Principles
  • The Basics You Need to Know About Affiliate Marketing
  • Affiliate Marketing Options
  • All About Affiliate Marketing
  • Classification of Database Management Systems
  • Three-Tier and n-Tier Architectures
    for Web Applications
  • Two-Tier Client/Server Architectures for DBMSs
  • Basic Client/Server Architectures in DBMS
  • Centralized DBMSs Architecture in DBMS
  • Tools, Application Environments, and Communications Facilities in DBMS

Categories

  • Affiliate marketing (5)
  • Algorithm (43)
  • amp (3)
  • android (223)
  • Android App (8)
  • Android app review (4)
  • android tutorial (60)
  • Artificial intelligence (61)
  • AWS (3)
  • bitcoin (8)
  • blockchain (1)
  • c (5)
  • c language (105)
  • cloud computing (4)
  • coding (4)
  • coding app (4)
  • complex number (1)
  • Computer Graphics (66)
  • data compression (65)
  • data structure (188)
  • DBMS (44)
  • digital marketing (9)
  • distributed systems (11)
  • ffmpeg (26)
  • game (3)
  • html (6)
  • image processing (35)
  • Inequalities (1)
  • information (4)
  • java (212)
  • java network (1)
  • javascript (9)
  • kotlin (4)
  • leetcode (1)
  • math (21)
  • maven (1)
  • mysql (1)
  • Node.js (8)
  • operating system (109)
  • php (310)
  • Principle Of Mathematical Induction (1)
  • programming (6)
  • Python (4)
  • Python data structure (9)
  • React native (1)
  • React.js (22)
  • Redux (1)
  • seo (4)
  • set (12)
  • trigonometry (6)
  • vue.js (35)
  • XML (3)

sitemap

sitemap of videos

sitemap of webstories

sitemap of website

  • Affiliate marketing
  • Algorithm
  • amp
  • android
  • Android App
  • Android app review
  • android tutorial
  • Artificial intelligence
  • AWS
  • bitcoin
  • blockchain
  • c
  • c language
  • cloud computing
  • coding
  • coding app
  • complex number
  • Computer Graphics
  • data compression
  • data structure
  • DBMS
  • digital marketing
  • distributed systems
  • ffmpeg
  • game
  • html
  • image processing
  • Inequalities
  • information
  • java
  • java network
  • javascript
  • kotlin
  • leetcode
  • math
  • maven
  • mysql
  • Node.js
  • operating system
  • php
  • Principle Of Mathematical Induction
  • programming
  • Python
  • Python data structure
  • React native
  • React.js
  • Redux
  • seo
  • set
  • trigonometry
  • vue.js
  • XML
  • Blog
  • Data compression tutorial - codingpoint
  • How to change mbstring in php 5.6
  • How to diagnose out of memory killed PHP-FPM
  • Introduction to jQuery
  • Privacy
  • Affiliate marketing
  • Algorithm
  • amp
  • android
  • Android App
  • Android app review
  • android tutorial
  • Artificial intelligence
  • AWS
  • bitcoin
  • blockchain
  • c
  • c language
  • cloud computing
  • coding
  • coding app
  • complex number
  • Computer Graphics
  • data compression
  • data structure
  • DBMS
  • digital marketing
  • distributed systems
  • ffmpeg
  • game
  • html
  • image processing
  • Inequalities
  • information
  • java
  • java network
  • javascript
  • kotlin
  • leetcode
  • math
  • maven
  • mysql
  • Node.js
  • operating system
  • php
  • Principle Of Mathematical Induction
  • programming
  • Python
  • Python data structure
  • React native
  • React.js
  • Redux
  • seo
  • set
  • trigonometry
  • vue.js
  • XML
  • Blog
  • Data compression tutorial - codingpoint
  • How to change mbstring in php 5.6
  • How to diagnose out of memory killed PHP-FPM
  • Introduction to jQuery
  • Privacy

© codingtube.tech