Php program to execute the get and post

A Php program to execute the get and post. Using this program we can get and post program in php. The POST method uses HTTP headers to send data. The data is encoded as specified for the GET method and stored in the QUERY STRING header. The data size that can be sent with the POST method is unrestricted. Both ASCII and binary data can be sent using the POST method.

<html>
<body>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
Name: <input type="text" name="fname">
<input type="Execute">
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$name = $_POST['fname'];
if (empty($name))
{
echo "Name is empty";
}
else
{
echo $name;
}
}
?>
</body>
</html>

Name: