$_server in php

$_server in php

When we talk about the data taken from a contact form, get the post, and request superglobals can be used. But when we need information about:

  • HTTP connection
  • Server information
  • Host information
  • URL information
  • other extra data
this superglobal is generally used when you want a single page to store and print data in a database.


$_SERVER['PHP_SELF']

Returns the filename of the currently executing page


$_SERVER['SERVER_NAME']

Returns the name of the host server. The IP address of the server


$_SERVER['REQUEST_METHOD']

used to know about the request method like POST or GET







When we talk about the data taken from a contact form, get the post, and request superglobals can be used. But when we need information about:

  • HTTP connection
  • Server information
  • Host information
  • URL information
  • other extra data
this superglobal is generally used when you want a single page to store and print data in a database.


$_SERVER['PHP_SELF']

Returns the filename of the currently executing page


$_SERVER['SERVER_NAME']

Returns the name of the host server. The IP address of the server


$_SERVER['REQUEST_METHOD']

used to know about the request method like POST or GET







0 Comments