get method

Ads
 

get method

how to use get method: secure method is post method and most of use post method why use a get method.

View Answers

May 26, 2011 at 11:48 AM

When using HTML forms you can set the form method parameter to either "GET" (default) or "POST". So, which one to use?

When working with GET method you can access all form variables with the $GET array in PHP and when using POST you can access the variables using $POST as shown in our PHP forms tutorial. No matter which method used you can also access all variables using $_REQUEST array.

When using GET all the submitted information is displayed in the address bar as part of the URL. You will see that as information shown after ? (called a query string), something like:

http://domain.com/script.php?name1=value1&name2=value2

This can be useful for example where you want to be able to bookmark a page with specific query string values. However, the GET method is limited by the length of the URL (2083 characters in Internet Explorer according to Microsoft) and each of the input values must not exceed 100 chars. Obviously you also don't want to use GET when submitting sensitive information like passwords or credit card details as they would show up in the address bar.

The POST method can send a lot of data (usually limited by the server settings) and should be used for every form unless the specific application benefits from the query string in the URL when using GET. No submitted data is shown in the address bar so most browser cannot correctly bookmark pages shown after a HTTP POST method.

There you have it. Unless you need the query string that you get when using the GET method (and aren't effected by it's limits) you should use POST for your forms. If you are submitting any sensitive information that should not be displayed in the address bar the only way to go is with the POST method.


May 26, 2011 at 12:08 PM

The get method is a SEO friendly method. It makes easier to set up for small, non-secure data. The variables get passed through the URL string, so you don't have to try to attach it to headers or worry about forms.

Request of get method can be bookmarked, can be cached, are faster and have known consequences, so visiting them multiple times is not a problem.

Ads









Related Tutorials/Questions & Answers:
get method
get method   how to use get method: secure method is post method and most of use post method why use a get method
advantages of get method?
advantages of get method?  php in what is advatages of get methods and how you can use get methods
Advertisements
why get method is used?
why get method is used?  why get method is used in 60% commercial application while using post is more secure
get and set method
get and set method  Create a class called Invoice that a hardware... a constructor that initialises the four instance variables. Provide a set and get method for each instance variable. In addition provide a method named
What is the difference between GET and POST method?
What is the difference between GET and POST method?  In PHP, both GET and POST method serves the same feature to get the data in variable. Still... it in detail with the case where we can use GET and POST method in PHP.   
Get Method of the Form In JSP
Get Method of the Form In JSP       This section provides you the best illustration of the get method of the form in JSP. The HTTP get method sends data to the server. In your JSP
Java Get Method
Java Get Method       In this example you will learn how to use the get method... when and how to use get method in Java.  The example is going to show
how to send spaces using get method.
how to send spaces using get method.  hi i want to know how to send spaces using get method? for example like http://localhost:8080/Sandeep?name... code: 1)form1.jsp: <html> <form method="get" action="form2.jsp"> <
HTML get Method
HTML get Method       The HTML get Method is used to submit the data of the page... The Tutorial helps you to understand an example from HTML get Method
Using get method in preferences
Using get method in preferences       In this section you will learn how to use the get() method... a simple way for using the get method in preferences. Get is the most useful
Multiple Value initialization and retrieval by put and get method
Multiple Value initialization and retrieval by put and get method... are going to find out the flow of using put and get method of the preferences. After reading, coding, and running you are able to use the get and put method. Here
Hibernate get
In this section, you will learn about get method of Hibernate
get
get ( ) Method in PHP  what is get method in PHP   Please visit the following link: http://www.roseindia.net/php/php-Get-Post.shtml
Get Calling Method
Get Calling Method       In this example we will find the name of the method. Description of the method used in the example: getStackTrace: Provides programmatic access
please let me get code how to insert a data to mysql using setter and getter method by using java
please let me get code how to insert a data to mysql using setter and getter method by using java  please let me get code how to insert a data to mysql using setter and getter method by using java pelease let me have the code
please let me get code how to insert a data to mysql using setter and getter method by using java
please let me get code how to insert a data to mysql using setter and getter method by using java  please let me get code how to insert a data to mysql using setter and getter method by using java pelease let me have the code
Hibernate Session Get
This part of discussion contain description of Hibernate session get () method
Java Servlet : Difference between GET and POST
Java Servlet : Difference between GET and POST In this section, we  will differentiate the GET and POST method of servlet. GET - It is HTTP method, asks to get thing at the requested URL. POST - It is HTTP method, asks
method
method   how and where, we can define methods ? can u explain me with full programme and using comments
HTML Get Radio Button
;  HTML Get  method in HTML is used to send the data as part of the URL. The get method is used for retrieving the data. In Get Method, the amount of data can be sent with a limited URL. Get method is used for sort forms
method
method  can you tell me how to write an abstract method called ucapan() for B2 class class A2{ void hello(){ system.out.println("hello from A2"); }} class B2 extends A2{ void hello(){ system.out.println("hello from B2
String indexOf() Method
of the method. Description of the code: Here, you will get to know about the indexOf... String indexOf() Method       In this section, you will get the detailed explanation about
FTPClient : Get System Type
This section explain how to get system type by using method of FTPClient class in java
get and post
get and post  what is php and get   PHP get and post method
charAt() Method In Java
charAt() Method In Java       In this section, you will get the detailed explanation about the charAt() method of String class. We are going for using charAt() method
JavaScript getAttribute method
JavaScript getAttribute method       JavaScript method getAttribute() is used to get... with the document.getElementById() method.          Syntax
How to work with POST method in jsp page
POST method instead of GET method in jsp page. GET is default method for sending... than using GET method as request method in JSP. For this we just need to set... How to work with POST method in jsp page
JSP Get URL
JSP Get URL          JSP Get URL is used to get the url of the current JSP page. The HttpServletRequest interface has a method getRequestURL
Java example program to get the environment variable
Java example program to get the environment variable       java get environment variable The getenv() method of the java.lang.System provide us the functionality to get
String indexOf() method in Java
String indexOf() method in Java In this tutorial we will discuss about indexOf() method in java. indexOf() method which is of string class,  used to locate a character or string.  The String class provide two method
service method in servlet
service method in servlet In this tutorial you will learn about the service method in servlet that how can it be defined, how to get information from requests , and how the response can be constructed. service method is a method

Ads