Post Methods

0 kaceyalbertson December 12, 2020

This is the collection of array variables that pass through the HTTP Post methods. The $_POST variable uses to collect the value from the post request. These parameters may be sent using PHP form with action POST.

This post method is the secure method to access the server because it is not accessible and visible to the normal user.

Example:

Let’s take an form to make clear concepts on POST request.

<form method="post" action="upload.php">
    <input type="text" name="country" />
    <input type="submit" value="Submit Country" />
</form>

When we submit the form then we can access the user input value as shown below.

<?php echo "Country Name : ".$_POST['country']; ?>

Why use POST Methods?

  • It is more secure than the HTTP get methods because it is not visible in the URL.
  • There is not limit in POST variable.