HTML form get
From w3cyberlearnings
Contents |
HTML - Form GET HTTP REQUEST
- Form GET HTTP REQUEST passes information/form data through the URL.
HTML - Syntax Form GET HTTP REQUEST
- attribute name: method
- attribute value: get
- attribute name: action
- attribute value: path/program (where the get REQUEST send to)
<form action="path/program" method="get"> ..... </form>
Note
- GET HTTP REQUEST is the default method.
- When a form uses the GET HTTP REQUEST method, the server side program is also need to use the GET HTTP REQUEST to get the form data.
- If the server side program uses POST HTTP REQUEST, the program will not be able to get the form data.
- Form data passes through the URL for the server side program to process, and by passing information through the URL exposes information and it is a security risk.
- Use POST HTTP REQUEST when you want to send form data such as password to the server because it is considered more secure than the GET HTTP REQUEST method.
Example 1: Passing form data to the server uses the GET HTTP REQUEST
<html> <head> <title>Test Get</title> </head> <body> <form action="test1.php" method="get"> Content place here </form> </body> </html>
Related Link
- Form Action
- Form POST
- Form GET
- Form Input Text