Oj Obasi
Oj Obasi

I am also and will continue to be a student of web design and development. My tutorials may not be for you. If you feel that way, then search online for better tutorials.

PHP Form GET or POST($_GET vs. $_POST)

Similarities and difference between 'Get' and 'Post'.

When to use GET Method:

The $_GET superglobal is an array of variables passed to the current script through the URL parameters.
Get is used to send insensitve insensitive information like search engine keywords.
With Get Method , the url can be bookmarked because the values are displayed in the url.
Get has a limit to the amount of information you can send :2000 characters.
When to use POST Method:

The $_POST superglobal an array of variables passed to the current script via the HTTP POST method.
When a form is submitted using the POST method, its data is invisible to others,
all values are embedded within the body of the HTTP request(you do want when your users try to login to your website, their password to be displayed in the url).
Post Method has no limits on the amount of information to send.
POST supports advanced functionality such as support for multi-part(enctype="multipart/form-data") binary input for uploading files to a server.

Both GET and POST create an array with a 'key' and a 'value'.
The key is the name of the form control and value is the input data from the user.

"Both GET and POST are treated as $_GET and $_POST. These are superglobals, which means that they are always accessible, regardless of scope - and you can access them from any function, class or file without having to do anything special".