Print Shortlink

$_SERVER PHP Variable usages with example

$_SERVER in PHP is very useful to getting lot of information about the PHP script in execution as well as the server/request details. $_SERVER is containing information such as headers, paths, and script locations. The entries(values)  in this array are created by the web server.


This php variable used to get currently executing script, relative to the document root. This variable returns currently executing script.


This php variable used to get remote ip address. That is, it used to get client ip address. It return client IP Address.


This php variable used to get  server ip address. we can get executing server ip address.


This variable use to make request server. The actual URI used in HTTP protocol (after GET or POST) to make the request.


This variable used to get client browser details like to check which browser using client.

Share this!!!!!!!!!!!!!!!!

Leave a Reply

+ five = 14

Read previous post:
PHP directory listing script

I here explained to list the directory files using php (server side scripting language).   <?php    function list_files($dir) {...