![]() Your email address: will get the above output, if you provide name as "Studytonight" and email address as PHP Form Handling with GET ![]() If we specify the form method to be POST, then the form-data is sent to the server using the HTTP POST method.īelow, we have the code, to access the form-data in the Php file specified in the action attribute of our HTML form. method: This attribute specify the means of sending the form-data, whether it will be submitted via POST method or GET method.īelow we have the same form with method as GET,.In the example above, we have provided name of a Php file. action: Using this attribute, we can specify the name of the file which will collect and handle the form-data.In the tag, we have two attributes, action and method, do you know what they are for? In the code above, we have used the tag to create an HTML form, with input fields for Name and Email along with submit button to submit the form-data. ![]() Let's create a simple HTML form and try to understand how it works, what are the different attributes available in the tag and what are they used for. PHP provides two superglobals $_GET and $_POST for collecting form-data for processing. When we develop a website or a web application, we often have to create forms to take input from users, like a Login form or a Registration form.Ĭreating a form on the webpage is accomplished using HTML, while PHP serves as a transport for those values from the webpage to the server and then in further processing those values. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |