The $_REQUEST variable contains the content of both $_GET, $_POST and $_COOKIES. The $_REQUEST variable is another PHP superglobal variable that you can use to dynamically retrieve form data sent from both Form GET and POST methods. The form data is then assigned to a variable that was used to display the results. $_POST: The form data is stored in the $_POST variable array by PHP since it is submitted through the POST method, and the element name attribute value – firstname (name=”firstname”) is used to access its form field data. Isset( $_POST ) : This line checks if the form is submitted using the isset() function, but works only if the form input type submit has a name attribute (name=”submit”). The $_GET Method Script: get-method.php // Check if the form is submitted if ( isset( $_GET ) ) The keys is created using the element’s name attribute values. PHP uses this $_GET variable to create an associative array with keys to access all the sent information ( form data ). When you submit a form through the GET method, PHP provides a superglobal variable, called $_GET.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |