PHP Superglobals: $_GET, $_POST, $_SERVER
Access request data and server info using PHP superglobal arrays.
Brian Watson
October 24, 2025
6.3k126
Superglobals are built-in arrays always available in PHP.
$_GET example
URL:
page.php?name=Alex
echo $_GET['name'];
$_POST example
HTML form:
<form method="post">
<input name="email">
<button>Send</button>
</form>
PHP:
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
echo $_POST['email'];
}
$_SERVER
echo $_SERVER['REQUEST_URI'];
Next: Handling forms safely.
#PHP#Forms#Beginner