Showing posts with label how to use post method in PHP. Show all posts
Showing posts with label how to use post method in PHP. Show all posts

Monday, 22 December 2014

Post method in PHP

Structure of the Problem Requirements 

In this problem we will learn how to implement Post method in PHP. In post method parameters are not saved in browser history. Get method's request can't be bookmarked. Post method is used when sending passwords or sensitive data. One thing about post method that we can send limited data and the maximum size is 8 MB. Here is the source code of this problem which help you in better understanding.

Source code 

<?php
if(isset($_POST['name']) &&isset($_POST['pd']) && isset($_POST['age']) && isset($_POST['sex'])) {
$name = $_POST['name'];
$pd = $_POST['pd'];
$age = $_POST['age'];
$sex = $_POST['sex'];
}
?>
<html>
<title> GET METHOD IN PHP </title>
<body>
<form action="index.php" method="POST">
Name: <br> <input type="text" name="name" ><br>
Password: <br> <input type="password" name="pd" ><br>
Age: <br> <input type="number" name="age" ><br>
Sex: <br> <input type="text" name="sex" ><br>
<br> <input type="Submit" name="Submit" ><br>
</form>
</body>
</html>

Output of the Program

Post Method in PHP
Post Method in PHP