How to use Get values in PHP

Опубликовано: 30 Сентябрь 2024
на канале: Internet Services and Social Networks Tutorials from HowTech
4,564
7

This tutorial will teach you to retrieve values from a form using the variable get inside PHP

Don't forget to check out our site http://howtech.tv/ for more free how-to videos!
   / ithowtovids   - our feed
  / howtechtv   - join us on facebook
https://plus.google.com/1034403827176... - our group in Google+

In this tutorial you will learn how get values in php from a form using the variable get in PHP. We'll create two input fields which will get input value from the user.

Step 1: Get values in Php

In PHP, we use the predefined variable $_GET to get values in php form with method = get. In the example below, a form "home.php: has been created which inquires the user for his name and email Id. The user fills in the information and press the submits button

Step 2: Finding values from the GET variable in PHP

From php get input value once the user has filled in the values and pressed the submit button, the values can be retrieved from the form using the variable $_GET.
The data that has to be retrieved is written in square brackets, right after the keyword $_Get and the brackets are followed by a semicolon which is a statement terminator. In the below example, the name and the email id of the user is being retrieved by using the variable $_GET.