Forms in php

By | December 26, 2013

In PHP webapplication development to collect form data to another page we will use

the following methods

$_GET– this is used in the case when the form action is GET
$_POST– this is used in the case when the form action is POST

Sample form as below

index.php
———


Name:
Age:


innerpage.php
————-

if we change the method as GET in index.php like below

Then inner.php will change as to

Note: if you print the post and get varibles print using print_r in inner.php then you can see that it will return as an array.