PHP POST Variables

PHP Global Variables tutorial will explains you How to use PHP Global Variables? with examples & Syntax.

Some predefined variables in PHP are “superglobals”, which implies that they are dependably approachable, paying little mind to extension – and you can access them from any function, class or file without needing to do anything special.

List of Global Variables in PHP
$GLOBALS
$_SERVER
$_REQUEST
$_POST
$_GET
$_FILES
$_ENV
$_COOKIE
$_SESSION

PHP $GLOBAL

PHP $GLOBAL is super global variable which is utilized to enter global variables from anyplace in the PHP script.

Example on PHP $GLOBAL

PHP $_SERVER

PHP $_SERVER is a super global variable which holds data about headers, paths, and script areas.

Example on PHP $_SERVER

PHP $_REQUEST:

PHP $_REQUEST is used to collect data after submitting an HTML form

Example on PHP $_REQUEST

PHP $_POST

Most forms use the POST method because it “hides” form data from user since it doesn’t get attached with the URL in the address bar. This data is collected using $_POST variable (which is in array format) in php script

Example on $_POST

myform.html:

collect.php

$_GET

PHP GET method sends its variables through web browsers URL, which makes it visible and possibly change the information that was sent.

Example

myform.html:

PHP $_FILES

An associative array of items uploaded to the current script via the HTTP POST method.

uploader.php

PHP $_ENV

An associative array of variables passed to the current script via the environment method

Example on $_ENV

PHP $_COOKIE

PHP Cookie is usually a small piece of data sent from a website and stored in an user’s web browser while an user is browsing a website. One simple route to maintain data between the diverse pages in a web application is with PHP cookies.

PHP $_SESSION

PHP Session allows an application to store information for the current “session”.

SHARE
Previous articlePHP GET Variable
Next articlePHP Constants
I am a young Information Systems Security Engineer(CEH). I had started with penetration testing when i am 17 years old. It all started with Kali linux and Metasploit.In free time i will play with Security holes/Bug bounty/Pentesting and Hacking !!!