REBOL Document

Decode-cgi - Function Summary


Summary:

Converts CGI argument string to a block of set-words and value strings.

Usage:

decode-cgi args

Arguments:

args - Starts at first argument word. (must be: any-string)

Description:

Constructs a block of word value pairs from a name=value text string argument delineated with the "&" character. Obtain CGI queries by using DECODE-CGI to evaluate system/options/cgi/query-string, where CGI query strings are stored for reference.


    ex-query-string: "fname=John&lname=Doe&email=who@where.dom"
    cgi-input: make object! decode-cgi ex-query-string
    print probe cgi-input
    
    make object! [
        fname: "John"
        lname: "Doe"
        email: "who@where.dom"
    ]
    ?object?


    print ["Name:   " cgi-input/fname cgi-input/lname]
    print ["Email:  " cgi-input/email]
    Name:    John Doe
    Email:   who@where.dom


<Back | Index | Next>

Copyright 2004 REBOL Technologies