The enctype attribute specifies how the browser encodes and presents the data to the server.
<!DOCTYPE HTML> <html> <body> <form method="post" action=""> <input name="fave"> <input name="name"> <button>Submit</button> </form> </body> </html>
If using application/x-www-form-urlencoded encoding
The name and value of each data item is encoded using the same scheme that is used to encode URLs. This is how the encoding is applied to the data in the example form:
Special characters are replaced with their HTML entity counterpart. The name of the data item and the value are separated by the equals sign (=) and data/value tuples are separated by the ampersand character (&).
The multipart/form-data encoding tends to be used only for uploading files. Here is how the data from the example form is encoded:
----WebKitFormBoundary2desQWER543CDFGF Content-Disposition: form-data; name="fave" YourName ------WebKitFormBoundary2desQWER543CDFGF Content-Disposition: form-data; name="name"
The mainstream browsers encode data in different ways for this encoding.
Google Chrome encodes data in the same way as for the application/x-www-form-urlencoded scheme, whereas Firefox encodes the data as follows:
Each data item is placed on a line, and special characters are not encoded.