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.

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.









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
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
Advertisements
advantages of get method?
advantages of get method?  php in what is advatages of get methods and how you can use get methods
question for "get method"
question for "get method"  when I want make method "get" for name or any char or string ..how I can write the syntax ? and what does it return
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
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
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 and POST Method of HTTP
;    GET The Get is one the simplest Http method. Its main job... page, a sound file, a picture file (JPEG) etc. We can say that get method.... In get method the data we send get appended to the URL so whatever you will send
POST AND GET METHOD - JSP-Servlet
POST AND GET METHOD  I AM LITTLE BIT CONFUSED IN GET() AND POST() METHODS. PLZ GIVE ME BREIF INTRODUCTION ABOUT THESE ??:)  Hi Friend...://www.roseindia.net/jsp/how-work-post.shtml http://www.roseindia.net/html/html-get
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. ADS_TO_REPLACE_1 The example
HTML get Method
HTML get Method       The HTML get Method is used to submit the data of the page... The get method is used to transfer the data as part of the URL and the data
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
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"> <
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
HTTP Status 405 - Request method 'GET' not supported. Its urgent
HTTP Status 405 - Request method 'GET' not supported. Its urgent  ...') in onclick method, following error is displaying in new window. "HTTP Status 405 - Request method 'GET' not supported." Anybody reply ASAP, its urgent
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
method
method   how and where, we can define methods ? can u explain me with full programme and using comments
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
Hibernate get
In this section, you will learn about get method of Hibernate
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
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
Hibernate Session Get
This part of discussion contain description of Hibernate session get () method
init method
init method  why init method used in servlet?   The init() method is called only once by the servlet container throughout the life of a servlet. By this init() method the servlet get to know that it has been placed
method inside the method??
method inside the method??  can't we declare a method inside a method in java?? for eg: public class One { public static void main(String[] args) { One obj=new One(); One.add(); private static void add
Method
Method       In this section, we will explore the concept of method in the reference of object oriented... and behaviors are defined by methods. Method : An brief introduction Methods
String indexOf() Method
of the method. Description of the code:ADS_TO_REPLACE_1 Here, you will get to know about... String indexOf() Method       In this section, you will get the detailed explanation about
Java Servlet : Difference between GET and POST
; 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... in your form method="POST". HTTP GET request is default .  
method question
method question  How do I figure out the difference in a method heading, a method body, and a method definition
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
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 Overloading
Method Overloading  In java can method be overloaded in different class
Method Overloading
Method Overloading  In java can method be overloaded in different class
A method getColumnCount.
A method getColumnCount.  There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set
FTPClient : Get System Type
This section explain how to get system type by using method of FTPClient class in java
How to work with POST method in jsp page
POST method instead of GET method in jsp page. GET is default method for sending... method is nothing different than using GET method as request method in JSP... How to work with POST method in jsp page
JavaScript getAttribute method
JavaScript getAttribute method       JavaScript method getAttribute() is used to get... with the document.getElementById() method.   ADS_TO_REPLACE_1      ADS
abstract method
abstract method  is final method is in abstract class
Static method
Static method  what is a static method?   Have a look at the following link: Java Static Method
gc() method
gc() method  what is difference between java.lang.System class gc() method and java.lang.Runtime class gc() method
method name
method name  Is there any method which is equivalent to c++'s delay(int) function
main method
main method  Why is the java main method static
main method
main method  What is the argument type of a program's main() method
Checkbox method
Checkbox method  what is the method to check if the checkbox is checked
abstract method
abstract method  Can a concrete class have an abstract method
Method overriding
Method overriding  How compiler decide parent class'method or child class's method to call? What is the meaning of this: Parent obj=new child_obj
finalize() method
finalize() method  Can an object's finalize() method be invoked while it is reachable?  An object?s finalize() method cannot be invoked... finalize() method may be invoked by other objects
_jspService() method
_jspService() method  Why is jspService() method starting with an '' while other life cycle methods do not?   jspService() method... don't override _jspService() method in any JSP page
java method
java method  can we declare a method in java like this static... book. i don't understand the static { } plz help me. what kind of method is it, what it do, what are the advantages of this kind of method? Answer me soon
method overloading
method overloading  public void test(int a){} public void test(long a){} i will call some x.test(125) which method is called pls tell me

Ads