$_GET is an associative array of variables passed to the current script via the URL parameters.
$_GET is a PHP
$_GET is also used to collect form data after submitting an HTML form with
You can also use $_POST to get form data. The difference between
$_POSTis that the former uses URL parameters to pass form data, while the latter uses the HTTP POST method.
Suppose a user visits the URL:
You can access the
age parameters using
<html> <body> <?php echo "Hello, " . $_GET['name']; // "Hello, John" echo "Your age is " . $_GET['age']; // "Your age is 25" ?> </body> </html>
View all Courses