Hi Ed,

decode-cgi returns a block containing set-word string pairs. Given

>> cgi-input: "name=Ed&[EMAIL PROTECTED]"
== "name=Ed&[EMAIL PROTECTED]"

decode-cgi will return

>> decode-cgi cgi-input
== [name: "Ed" email-address: "[EMAIL PROTECTED]"]

Note that the set-words name: and email-address: have not been evaluated,
and therefore the words 'name and 'address have not been associated with
the respective string values at this point in time.

The recommended thing to do with the block returned by decode-cgi is to use
it to create an object:

>> user-input: make object! decode-cgi cgi-input

Now you can retrieve the values by addressing the words in path notation:

>> user-input/name
== "Ed"
>> user-input/email-address
== "[EMAIL PROTECTED]"


You have other options. For instance you could simple 'do the block
returned by decode-cgi:

>> do decode-cgi cgi-input
== "[EMAIL PROTECTED]"

in which case the words become globally defined and you can evaluate them
like any other global word:

>> name
== "Ed"
>> email-address
== "[EMAIL PROTECTED]"

To use the email address as an email address, you have to convert it to a
value of datatype email address

>> to-email user-input/email-address
== [EMAIL PROTECTED]
or

>> to-email email-address
== [EMAIL PROTECTED]

respectively.

Hope this helps



;- Elan >> [: - )]

Reply via email to