Data Sets: Name/Value Pairs
-
All form elements have NAME and VALUE
attributes.
The names are specified on the NAME attributes of form
input elements, and the values are given initial values by various
forms of
markup and edited by the user.
-
Several radio buttons can share the same name,
as this is how you specify that they belong to the same control group
- at any time, only one button in the group can be selected.
Note: The contents list of name/value pairs excludes unselected
radio buttons and checkboxes.
In general, any field with a null value can
be omitted from the contents list.
-
Data are sent as name=value pairs,
separated by ampersands (&),
where name was given in the NAME
attribute,
and value was given in the VALUE
attribute, or replaced by the user.
-
Each name=value pair is
URL
encoded, i.e. spaces are changed into plusses and some characters are
encoded into hexadecimal.
-
The basic processing procedure is to split the data by the ampersands.
Then, for each name=value pair,
you should URL decode the name,
and then the value, and then process as needed.
In Perl, you will typically place the values into an associative array
indexed by their corresponding names.
|