How to use REQUEST with FORM in php

PHP

PHP is used with HTML Forms so we can get the form data in php. There are three methods for the form data collection POST, GET and REQUEST. We have shown you a simple example how to use the REQUEST method with HTML FORMS.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Example for Using forms in PHP</title>
</head>
<body>
<!--We will create one simple form with two fields first name and last name-->
<!--This is the simple example for request method with form in php-->
<form name="myform" action="" method="post" id="myform">
<p>
<label>First Name</label>
<input type="text" name="fname" id="fname" value="" />
</p>

<p>
<label>Last Name</label>
<input type="text" name="lname" id="lname" value="" />
</p>
<p>
<input type="submit" value="Submit" name="save" id="save" />
</p>

</form>
<?php
if(isset($_REQUEST['save']))
{
echo 'Your Name-'.$_REQUEST['fname'].' '.$_REQUEST['lname'];
}
?>
</body>
</html>
-->