By 07/04/2016

What Is Html Form Post Method In PHP?

  • When you create a dynamic website you need to use input forms for getting user input data.
  • A form is also called web form and it can be created using the form tag in Html, every form uses an attributes called “method = Post”, that method attribute isĀ used to send user input data to the server (A PHP page).
  • A Post method is always used to send large data of user through an Html form to the PHP server.
  • There are many advantages of Post method such as it is secure, collect large user input data to PHP etc.
  • The $_POST['control_name'] PHP’s super global variables is used to fetch a value sent by post method.

Example:

<!Doctypes html>
 <html>
 <head>
 <title>Html Form Post Method In PHP</title>
 </head>
 
 <body>
 <?php 
 if(isset($_POST['btn_submit'])) {
 $user_name = $_POST['user_name'];
 $contact = $_POST['contact'];
 
 echo "Name is: " . $user_name . "<br>";
 echo "Contact: " . $contact;
 }
 ?>
 <form method="post" action="">
 <input type="text" name="user_name" placeholder = "Enter Name"> <br><br>
 <input type="text" name="contact" placeholder = "Enter Contact"> <br>
 
 <button type="submit" name="btn_submit"> Submit </button>
 </form>
 </body>
 </html>






Posted in: HTML, PHP, Solutions

Comments are closed.

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .