Difference between GET and POST method?

Get methods are used to send data to the server.

GET method

(i) GET method data is sent through query string and display browser’s address field.

Example:-


$url="http://abc.com?email=john@abc.com&name=john"

Note:- in the above URL first query string add through ? mark after that add query string through & mark.

(ii) GET method is mostly used for submitting a small amount and less sensitive data.

How to get form field’s value through GET method

You can get form fields value through $_GET[] array method.
Example:-


$get_email=$_GET['email'];

POST method

(i) POST method data is sent by standard input (nothing shown in browser’s address field).
(ii) POST method is mostly used for submitting a large amount or sensitive data.

How to get form field’s value through POST method

You can get form fields value through $_POST[] array method.
Example:-


$post_email=$_POST['email'];

Difference between GET and POST method? – Objective Questions (MCQs)

Q1. GET method sends data via ______.






Q2. POST method sends data via ______.






Q3. Which method is more secure for sensitive data?






Q4. Which method has size limitations?






Q5. Which method is bookmarkable?






Related Difference between GET and POST method? Topics