PHP post method and data collection

, by Prashant Gunjal

We can use post method to collect data in another program which is called in action . Actually we can collect data from $_POST[] array as :

Program :

13.html

<html>
<head>
<title>POST METHOD</title>
</head>
<body>
<form method="post" action="13.php">
Enter First Name : <input type="text" name="fname"><br>
Enter Last Name : <input type ="text" name="lname" ><br>
<input type="submit" name="CLICK HERE">
</form>
</body>
</html>

program file 13.php is

<?PHP
    $fname=$_POST['fname'];
    $lname=$_POST['lname'];
    echo "First name is $fname and last name is $lname";
?>

OUTPUT :





0 comments: