May 11, 2021 PHP
In PHP, a predefined $_POST variable is used to collect values from a form that is "post" and $_POST is often used to pass variables.
The predefined $_POST variable is used to collect values from forms that are "post" in the method.
The information sent from a form with a POST method is not visible to anyone (it does not appear in the browser's address bar) and there is no limit to the amount of information that can be sent.
Note: By default, however, the POST method sends a maximum of 8 MB of information (which can be changed by setting the .ini in the post_max_size php file).
<form action="welcome.php" method="post">
Name: <input type="text" name="fname">
Age: <input type="text" name="age">
<input type="submit">
</form>
When the user clicks the "Submit" button, the URL looks like this:
The welcome .php file can now collect form data from the $_POST variable (note that the name of the form field automatically becomes the key in the $_POST array):
Information sent from forms with post methods is not visible to anyone and there is no limit to the amount of information that can be sent.
However, because the variable does not appear in the URL, the page cannot be bookmarked.
The predefined $_REQUEST variable contains $_GET, $_POST, and $_COOKIE content.
The _REQUEST variable can be used to collect form data sent through the GET and POST methods.