Tuesday, 31 January 2017

INTRODUCTION ON FORM IN PHP

In HTML, Form is a container used to hold some input controls. If we want to transfer control values from one place to another place after clicking on Submit button, we can use form tag. It contains some properties –
1. action – To specify the page name to which place we want to submit form data.
2. method – To specify the type of method what we want to use to submit form data (get/post).


Difference between Get and Post

GET
POST

Get information is visible on URL address.

Post information is not visible on URL address.
Get is not encoding data, that's why it is not secured.

Post is encoding data, hence it is secured than Get.
Get transfers limited amount of data.
Post transfers large amount of data.


Get is faster.

Post is slower as compared to Get.
Get cannot upload files.

Post can upload files

Example –
<form action=”p1.php” method=”get”>
          <input type=”text” name=”t1”>
          <br>
          <input type=”submit” value=”Click” name=”Sub”>
</form>

No comments:

Post a Comment