PHP POST Method

PHP POST Method

For sending information to the web server, which is secure, use PHP POST method. The information sent through the server isn’t visible in the URL, unlike the PHP GET() method.

Let’s learn about some interesting points about POST method,

  • Use POST, if you want to send passwords.
  • Information sent via GET method is hidden and can’t be seen in the URL.
  • There is no limitation on characters, while sending information through POST.
  • PHP superglobals $_POST is used to collect form data with POST.
  • You can send ASCII as well as binary data, via GET.

 

Example

Here, we have two files. The first one is an HTML form,

HTML Form

The second file is success.php that will open if the form submission is successful. We’re using superglobal variable $_POST to collect form data with POST.

Here, you can see the variable values name and age aren’t visible in the address bar. One of the benefits of using POST method is that it is secure, since the values are hidden.

PHP POST Method

PHP GET Method
PHP Functions
Studyopedia Editorial Staff
Studyopedia Editorial Staff
[email protected]

We work to create free tutorials for all.

No Comments

Post A Comment