Passing Form Data

After a user enters form data and clicks a Submit button, the browser does two things. First, it encodes the form data into a single string. Then it sends the encoded string to the server by either the get or post HTTP method. The next two sections close out the chapter by providing details on each of these steps.

URL Encoding

When a user clicks the Submit button on a form, the browser gathers all the form data and assembles it into a string of name=value pairs, each separated by an ampersand (&) character. This process is called encoding. It is done to package the data into one string that is sent to the server.

Consider the following HTML code:

 <form action="http://www.server.com/cgi-bin/process_it.cgi" method="post"> Favorite ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.