Form Data

Form Handling Methods

There are 2 methods for sending form data to a PHP page:

GET

POST

HTML Form Example

Assigning Server Side Variables

The code below will store the variables that have been passed in using the form above. You will notice that the identifiers in the square brackets match up with the name of the inputs in the HTML form.

When to use GET or POST

GET is the default method if you don’t specify and is the least secure

POST 

Advantages/Disadvantages of POST/GET Methods

Advantages of GET

Disadvantages of GET

Advantages of POST

Disadvantages of POST