Get vs Post

Discussion in 'PHP' started by Silent_Heart, Nov 28, 2011.

Thread Status:
Not open for further replies.
  1. #1
    Hello


    which is the basic difference between the " Get " and " Post " method ?

    where we need to use " Get " and " Post " method ?

    thanks
    ayaz ali
     
    Solved! View solution.
    Silent_Heart, Nov 28, 2011 IP
  2. iliveforyou

    iliveforyou Active Member

    Messages:
    207
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    Use Post is more safe than Get.
    Get is showing your parameter data in url (ex: www.yoursite.com?id=1 )
     
    iliveforyou, Nov 28, 2011 IP
  3. 7thand43rd

    7thand43rd Member

    Messages:
    84
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    43
    #3
    Get and Post are both just ways to submit information over to another page, neither is more secure than the other because neither of them encrypt the data. Get is used for simpler queries, like searches (i.e. search.php?q=when+to+use+get) as Get is shown in the URL and information can be retrieved by $_GET. Post is used when you submit more information, as in an order form, and the information can be retrieved by $_POST. Both can be retrieved by using $_REQUEST.
     
    7thand43rd, Nov 28, 2011 IP
  4. Silent_Heart

    Silent_Heart Active Member

    Messages:
    69
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    96
    #4
    thanks for reply

    great and i understand that all. well thanks for great help


    Best Regards
    Ayaz Ali
     
    Silent_Heart, Nov 29, 2011 IP
  5. #5
    That depends what you are sending.

    If you are sending login details e.g. a password, the user is going to be pretty mad if they suddenly see that appear in the URL.

    GET is also limited on the amount of information you can send, the length of your post string can be way longer than get.

    Basically use GET if it doesn't matter if the user can see the parameters and you would like the user to revisit that page by pasting the URL in the address bar.

    Use POST if you will be exceeding GET's limit, posting sensitive information or you don't want the user to be able to repeat the process by simply pasting a URL.
     
    Divided, Nov 29, 2011 IP
  6. sarahk

    sarahk iTamer Staff

    Messages:
    28,899
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
Thread Status:
Not open for further replies.