eXtropia: the open web technology company
Technology | Support | Tutorials | Development | About Us | Users | Contact Us
 ::   Tutorials
 ::   Presentations
Perl & CGI tutorials
 ::   Intro to Perl/CGI and HTML Forms
 ::   Intro to Windows Perl
 ::   Intro to Perl 5
 ::   Intro to Perl
 ::   Intro to Perl Taint mode
 ::   Sherlock Holmes and the Case of the Broken CGI Script
 ::   Writing COM Components in Perl

Java tutorials
 ::   Intro to Java
 ::   Cross Browser Java

Misc technical tutorials
 ::   Intro to The Web Application Development Environment
 ::   Introduction to XML
 ::   Intro to Web Design
 ::   Intro to Web Security
 ::   Databases for Web Developers
 ::   UNIX for Web Developers
 ::   Intro to Adobe Photoshop
 ::   Web Programming 101
 ::   Introduction to Microsoft DNA

Misc non-technical tutorials
 ::   Misc Technopreneurship Docs
 ::   What is a Webmaster?
 ::   What is the open source business model?
 ::   Technical writing
 ::   Small and mid-sized businesses on the Web

Offsite tutorials
 ::   ISAPI Perl Primer
 ::   Serving up web server basics
 ::   Introduction to Java (Parts 1 and 2) in Slovak


introduction to web programming
URL Encoding  
Besides allowing web browsers (or you pretending to be one) to get documents from a web server, the GET method also implements a method for a web browser to send optional search parameters as well (it was used with ISINDEX HTML files originally).

Search parameters were encoded in a special way that the web server can deal with. Encoding works like this:

The URL is differentiated from the search parameters by a question mark (?). In other words, a URL generically looks like the following:

     http://www.domain.com/dir/file?search parameters

Since you may want to have multiple search parameters, the GET method specifies that parameters are differentiated by placing an ampersand sign (&) between them. Thus, the encoded URL above becomes something like the following:


Next, search parameters themselves are specified as "name/value pairs" separated by an equal sign (=) such as in the following example that sets the variable "lname" equal to "Sol" and the variable "fname" equal to "Selena":


Further, any spaces in the encoding string are replaced by plus signs (+) as in the following example:


Finally, any non-alphanumeric characters are replaced with their hexadecimal equivalents that are escaped with the percent sign (%). For example, a single quote character (') is encoded as %27 and a line break (which is a carriage return plus a line feed) is encoded as %0D%0A. Thus, we might see the following example that specifies that the variable pageName is equal to "Selena Sol's Page":


Previous | Next | Table of Contents