Part 02 – PHP POST Method

Sample PHP form submission using POST method

GetForm.php

<!DOCTYPE HTML>
<html>
<title> PHP POST Method </title>
<head> Php Form Submission using Post Method  </head>
<body>
<form method="post" action="output_post.php">
Student Name:<input type="text" name="name"><br><br>
Class:<input type="text" name="class"><br><br>
Section:<input type="text" name="section"><br><br>
marks1:<input name="marks1"><br><br>
marks2:<input name="marks2"><br><br>
marks3:<input name="marks3"><br><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>

Output_post.php

 <?php
echo "Output";
echo "<br> <br>";
echo  $_POST["name"];
echo "<br>";
echo  $_POST["class"];
echo "<br>";
echo  $_POST["section"];
echo "<br>";
echo  $_POST["marks1"];
echo "<br>";
echo  $_POST["marks2"];
echo "<br>";
echo  $_POST["marks3"];
?>

UI:-

Output:-

Leave a Reply

Your email address will not be published. Required fields are marked *