PHP Superglobals GET

Back to ACP page

Table of Contents

PHP Query string in the URL

1-tag-a.php

<!DOCTYPE html> <html> <body> <a href="2-demo_phpfile.php?subject=PHP&web=W3schools.com">Click</a> </body> </html>

Example 1 1

Result View Example

2-demo_phpfile.php

<!DOCTYPE html> <html> <body> <?php echo "Study " . $_GET['subject'] . " at " . $_GET['web']; ?> </body> </html>

Example 1 2

Result View Example

PHP GET_in_HTML_Forms

1-HTML_Forms.php

<h2>GET_in_HTML_Forms</h2> <p>1-HTML_Forms.php </p> <form action="2-welcome_get.php" method="GET"> Name: <input type="text" name="name"> E-mail: <input type="text" name="email"> <input type="submit"> </form>

Example 2 1

Result View Example

<h2>GET in HTML Forms</h2> <p>2-welcome_get.php </p> Welcome <?php echo $_GET["name"]; ?><br> Your email address is: <?php echo $_GET["email"]; ?>

Example 2 2

Result View Example

Document

Document in project

You can Download PDF file.

Reference