The most important part when dealing with HTML forms .POST method supporting multiple request at same time by HTTP protocol used by www(world wide web).POST method used in same way as the GET method. The POST method is used to send the hidden information for the users on HTML web server. In the POST method we can send large information of data forms.
Note: However, there is an 8 Mb max size for the POST method, by default.
(If you want to increase the post_max_size can be changed by setting the post_max_size in the php.ini file).
EXAMPLE:-
The POST method is very simple to use in the HTML form .The example below contains an HTML form with two input fields and a submit button: Index.html <html> <body> <form action="action.php" method="post"> <p>User Name: <input type="text" name="user_name" /></p> <p>Password: <input type="password" name="password" /></p> <input type="submit" name="submit" value="Submit" /> </form> </body> </html> When user fill the text field in form click on submit button the data will be send to PHP file called "action.php"
The URL will look like this: http://www.your-domain-name.com/action.php action.php <?php if(isset($_POST['submit'])) { echo $user_name = $_POST['user_name']; echo $password = $_POST['password']; } ?>
The "isset" function used to determine any variable has been set or not. The built-in $_POST function is used to collect values from a form sent with method="POST". Echo is used for display the form data on HTML web Page.
Output could be something like this:
User Name 12345678