All TalkersCode Topics

Follow TalkersCode On Social Media

devloprr.com - A Social Media Network for developers Join Now ➔

HTML Forms

HTML forms is used collect and transfer user data from user side like email address,name,phone no etc through various form elements like text fields,textarea,checkbox,radio buttons atc.


Example of HTML Form

<form action="Script Url" method="GET/POST">
Any Kind of form elements like input field,textarea etc.
</form>

HTML Form Attributes


  • action: backend code file url that is used to process user transfered data

  • method: it is used to upload data.Two type of methods are used GET or POST

  • target: is used to specify target window or frames where the form result is displayed.It takes values like _blank, _self , _parent etc.

  • enctype:it is used to tell the browser how to encode data before it sends to the server.It takes value like application/x-www-form-urlencoded: this value is used    in general cases,mutlipart/form-data: it is used when you want to uplaod binary data like images,text file etc.


HTML GET Attributes

When you use GET the form data will be visible in the page address.So it is highly recommended not to use GET when you have to send sensitive informations.

demo.php?name=Rohit&course=Btech


HTML POST Attributes

When you use POST the form data will be send in better security and the data is not visible in page address.


❮ PreviousNext ❯