JotForm User Guide / Advanced Features /

PHP Forms Explained

PHP Forms Explained

In this article, we’re not going to explain to you the depths of PHP forms or give code to work on, but you’re going to get an idea of how PHP methods work with forms. There are 2 ways PHP can interact with forms.


GET Method

This method uses the predefined $_GET variable which gets the submitted data on forms and pastes it to the URL. This method is commonly used in database searches because it displays the information to everyone including sensitive information like passwords. There’s also a character limit of 2000.


Example:



After clicking subscribe and thinking you’re safe, check out how the URL is shown with the GET method.



That’s why using the GET method for web forms is not secure. You can also view the form entries in any page you like and paste in HTML codes with the GET method.

php-forms2

The following method is used more commonly on PHP forms because the information sent is not visible to others.

POST Method
This method uses the predefined $_POST variable which doesn’t post the data from a form to the URL and as mentioned above it is better to use this method for sensitive information collecting. There are no limits on the amount of data to be sent from forms.

Example:


After clicking login, checkout how the data isn’t posted to the URL, unlike the GET method.

php-forms-url2

You can also collect the form data and paste it in HTML like the GET method.

php-forms2
As you can see, there are advantages and disadvantages of using these methods. However, in short, this is why these forms are called “PHP Forms”. Forms that use PHP to capture and post data in an easy way.


Get started with PHP Form Generator now!

Send Comment

1 Comment...

  • jjcar

    How do I pass data via the post method to another site?