Difference Between Http Post & Get Methods with HTML

View: 386    Dowload: 0   Comment: 0   Post by: hanhga  
Author: none   Category: HTML-CSS template   Fields: Other

10 point/1 review File has been tested

Http Post and Get methods are a part of the HTML language. Both methods are used in HTML form to transmit user’s data to server side programming languages such as Php, Asp.net, Jsp etc. The following difference can be found between these two methods.

Introduction

Http Post and Get methods are a part of the HTML language. Both methods are used in HTML form to transmit user’s data to server side programming languages such as Php, Asp.net, Jsp etc. The following difference can be found between these two methods:

Http Post Method Http Get Method
Large data can be send to server (unlimited characters). Minimal data can be send to server (only 2048 characters are allowed).
Information can not be bookmarked in a browser. Information can be bookmarked in a browser.
Information is not visible in browser’s URL. Information is visible in browser’s URL.
Personal and secure information can be sent. Don’t send Personal and secure information.
Any secure information can not be hacked. Any secure information can be hacked easily.
Mostly is used with HTML forms (recommended). Mostly is used with HTML hyperlinks to pass data between difference pages (recommended).
Information can not be cached. Information can be cached.

 

Example: PHP Http Post Method.

<!Doctypes html>
 <html>
 <head>
 <title>PHP Http Post Method</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>

Example: PHP Http Get Method.

<!Doctypes html>
 <html>
 <head>
 <title>PHP Http Get Method</title>
 </head>
  
 <body>
 <?php 
 if(isset($_GET['btn_submit'])) {
 $user_name = $_GET['user_name'];
 $contact = $_GET['contact'];
  
 echo "Name is: " . $user_name . "<br>";
 echo "Contact: " . $contact;
 }
 ?>
 <form method="get" 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>

Difference Between Http Post & Get Methods with HTML

Difference Between Http Post & Get Methods with HTML Posted on 24-08-2016  Http Post and Get methods are a part of the HTML language. Both methods are used in HTML form to transmit user’s data to server side programming languages such as Php, Asp.net, Jsp etc. The following difference can be found between these two methods. 10/10 386

Comment:

To comment you must be logged in members.

Files with category

 

File suggestion for you

File top downloads

logo codetitle
Codetitle.com - library source code to share, download the file to the community
Copyright © 2015. All rights reserved. codetitle.com Develope by Vinagon .Ltd