---
title: "PHP $_Get Function"  
description: "In this article I will be described, how to use $_Get function in PHP. In PHP, two function are available $_Get () and $_Post () for passing values fr"  
author: "Anonymous User"  
published: 2011-09-09  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/724/php-_get-function  
category: "php"  
tags: ["php"]  
reading_time: 2 minutes  

---

# PHP $_Get Function

In this [article](https://yourviews.mindstick.com/view/81489/kashmir-now-after-an-year-of-abrogation-of-article-370) I will be described, how to use $_Get [function](https://www.mindstick.com/articles/43970/purchase-suitable-wedding-dresses-for-your-wedding-function) in PHP. In PHP, two function are available $_Get () and $_Post () for [passing values](https://www.mindstick.com/forum/299/passing-values-from-one-view-to-another-view) from one [page to another page](https://www.mindstick.com/forum/118/problem-in-display-content-of-one-page-to-another-page), this [functions](https://www.mindstick.com/forum/34086/jquery-callback-functions) are used to get the values which are passed from a user-filled form ([User input](https://www.mindstick.com/forum/159624/setting-an-enum-from-user-input) value form), like user [registration](https://answers.mindstick.com/qa/116207/what-is-lei-registration) or [login form](https://www.mindstick.com/articles/41/login-form-in-asp-dot-net) etc.\

Now here I will be discussed on $_Get function and how to implement in PHP.

The built-in $_GET function is used to [collect](https://www.mindstick.com/interview/34468/how-do-you-collect-and-clean-datasets) values from a form sent with method="get". Information sent from a form with the GET method is visible to everyone (it will be displayed in URL) and has limits amount of information to send.

Let’s we have an example, how to use $_Get function in PHP.

##### Example:

```
<html>   <head>        <title> Get Methods</title>   </head>   <body>    <form action="GetMethod.php" method="GET">       <table>          <tr>            <td>Name:  </td>            <td><input type="text" name ="uname"/>            <td>          </tr>               <tr>                  <td>Age : </td>                  <td><input type="text"   name="age"/> </td>               </tr>                  <tr>                     <td></td>                     <td><input type="submit"   value="Submit"/> </td>               </tr>               </table>               </form>   </body></html>
```

Now when user click on ‘Submit’ button, the URL send to the server will look like this: http://localhost:85/MySiteFile/GetMethod.php?uname=Arun++Kumar+Singh&age=22Now “GetMethod.php” form used $_GET() function to collect [form data](https://www.mindstick.com/interview/34051/form-data-binding-and-submission-in-knockout).“GetMethod.php” file contains the following code.

```
<html>   <head>        <title> Get Methods</title>          </head>   <body>        <?php                 echo "Welcome :".$_GET['uname']."</br>";                 echo "you are ". $_GET['age']."years old";         ?>        </body></html>
```

Now the output will be:

![PHP $_Get Function](https://www.mindstick.com/mindstickarticle/7591b2ed-8eb3-4382-8e72-cd58767a7f29/images/fd20ae16-bde6-4e79-b2eb-e0963f40adf1.png)

When you click on ‘Submit’ button then ‘GetMethod.php’ will be showing as:

![PHP $_Get Function](https://www.mindstick.com/mindstickarticle/7591b2ed-8eb3-4382-8e72-cd58767a7f29/images/1c64d881-3283-41c1-8613-c1d7859dce0f.png)

\

---

Original Source: https://www.mindstick.com/articles/724/php-_get-function

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
