Which is the difference between $_get & $_post in PHP?

by 8 replies
12
I want get the difference please tell actual
#programming #$get #$post #difference #php
  • GET is the data sent to the server in the URL:
    For example:
    SOMETHIGN.com?a1=data&a2=moredata

    so the server get's the array: [a1=>data, a2=>moredata]

    Post is data sent through the HTTP and it is not visual to the user.
    • [1] reply
    • Hello
      The basic difference between $_get and $_post is
      In the $_get method is restricted to send upto 1024 characters only and the PHP provides $_get associative array to access all the sent information using GET method.Other hand $_Post method does not have any restriction on data size to be sent and the post method can be used to send ASCII as well as binary data.The PHP provides $_Post associative array to access all the sent information using POST method.
      • [1] reply
  • not 100% correct $_REQUEST = data from $_GET, $_POST, and $_COOKIE
  • It is mostly how the script reacts to the data.$get is pass it as visual to the user while $post is to pass it as http and hidden to the user.Obviously,$post is safer than $get protocol, who wants their information being posted on the site they visit.
    • [1] reply
    • POST is not much safer than GET unless there's something else to make it safer. You're still POSTing information to the site you're visiting. It's all in clear text unless you're using some form of encryption.

      Sure, the variables aren't visible in your address bar, and it might be harder to get the data from your browser history, but these are just side effects.
  • Banned
    [DELETED]
  • It amazes me how much people 'think' they know (and how positive they seem in their answers). ~%20 of information in these responses is incorrect.

    $_GET = PHP: $_GET - Manual
    $_POST = PHP: $_POST - Manual
    $_REQUEST = PHP: $_REQUEST - Manual

Next Topics on Trending Feed