Hello and welcome to the Webmasters Forums!. This is the best place to get webmasters resources for free. Get $2 for free today, read more - Make your payment today. Download premium and professional templates for free. Get free web hosting without ads, read more. You can get lot more by simply join with this forum. To gain full access to the forums you must sign up for a free account.


Post Reply  Post Thread 

CGI Encoding Scheme

Post Bank
Posting Manager
******

Posts: 995
Group: Forum Team
Joined: Sep 2006
Status: Online
Make money from now. You can make money just for posting on this forum. Every discussions on this community gives you more money. $2 minimum payout. So get your payment today, SignIn with this forum.

Signin to Remove this Post

casien
Newbie


Posts: 8
Group: Registered
Joined: Sep 2006
Status: Offline
Reputation: 0
Points: 0 (Donate)
Post: #1

CGI Encoding Scheme


Form data consists of a list of name/value pairs. Before transmitting this data to the server and the CGI program, the browser encodes the information using a scheme called URL encoding (specified by the MIME type application/x-www-form-urlencode). The encoding scheme consists of the following:

* URL encoding certain non-alphanumeric characters. This process consists of replacing these characters with a percent sign followed by the hexadecimal value of the character. Some of these characters and their corresponding hexadecimal values are here:
Chracter Hexadecimal Value
Tab 09
Space 20
" 22
( 28
) 29
, 2C
; 3B
@ 40
* Replacing spaces with the plus sign (+).
* Separating each name and value with an equal sign (=).
* Separating each name/value pair with an ampersand (&).

For example, suppose you have the following name/value pairs:

name Zhanshou Yu
major Computer Science
e-mail zyu@bayou.uh.edu

In order to encode these pairs, first replace the non-alphanumeric characters. In this example, only one charater exists,@, which is replaced with %40. So we have:

name Zhanshou Yu
major Computer Science
e-mail zyu%40bayou.uh.edu

Now, replace all spaces with a plus sign. We get:

name Zhanshou+Yu
major Computer+Science
e-mail zyu%40bayou.uh.edu

Seperate each name and value with an equal sign:

name=Zhanshou+Yu
major=Computer+Science
e-mail=zyu%40bayou.uh.edu

Finally, separate each pair with an ampersand (&):

name=Zhanshou+Yu&major=Computer+Science&email=zyu%40bayou.uh.edu

The CONTENT_LENGTH is equal to the number of character in the coding string. This example has 64 characters, so the CONTENT_LENGTH is 64.

29-09-2006 06:34 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites
Rate This Thread:

Forum Jump:

Sign In to Remove Ads

Download 1000's of web templates. Unlimited access!
World's Best Web Hosting
Website of the Month

Create-a-Page for Free
SOTM June 2008


Accepting Submissions
for July 2008
Resources

Recommended Sites:



Visit our Sponsors!

Current time: 20-08-2008, 05:36 PM


Copyright © 2002-2008 MyBB Group
Powered By MyBB