A Php program to execute the request and post method. In this program we can execute the request and post program in php. $_REQUEST is a global variable in PHP that is used to collect data after an HTML form has been submitted. The example below shows a form with an input field and a submit button. When a user submits form data by clicking “Submit,” the data is transferred to the file specified in the form> tag’s action element.
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
Name: <input type="text" name="fname">
if ($_SERVER["REQUEST_METHOD"] == "POST")
$name = $_REQUEST['fname'];
echo "File is empty";