Superglobals are built-in variables that are always available in all scopes. This means you can access them from any function, class, or file without having to do anything special.
Several predefined variables in PHP are "superglobals", which means they are global variables that are accessible regardless of scope. The most common ones are:
$GLOBALS$_SERVER$_POST$_GET$_FILES$_COOKIE$_SESSION$GLOBALS is used to access global variables from anywhere in the PHP script. PHP stores all global variables in an array called $GLOBALS[index].
$_SERVER is a superglobal variable which holds information about headers, paths, and script locations.
These are used to collect form data. $_POST is used for sending sensitive data (hidden from URL), while $_GET sends data through the URL parameters.
A session is a way to store information (in variables) to be used across multiple pages. Unlike a cookie, the information is stored on the server.
$_GET and $_POST to protect your website from SQL Injection and Cross-Site Scripting (XSS) attacks.