Facebook Pixel$_GET | PHP Tutorial | CodeWithHarry

$_GET

The PHP $_GET is a PHP superglobal which is used to collect form data after submitting an HTML form using method="get". Information sent from an HTML form with the GET method is displayed in the browser's address bar, making it less secure than POST.

Let's assume we have an HTML form that takes name and email as input and sends it to another file named name_get.php. We can access the values in name_get.php with the $_GET superglobal.

HTML FORM

<html>
<body>
 
<form action="name_get.php" method="get">
Name: <input type="text" name="name">
Email: <input type="text" name="email">
<input type="submit">
</form>
 
</body>
</html>

name_get.php

<html>
<body>
 
Welcome <?php echo $_GET["name"]; ?>!
Your email address is <?php echo $_GET["email"]; ?>
 
</body>
</html>

Output:

Welcome Harry!
Your email address is [email protected]