Re: Is This Linux?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Kat writes:
> How to i read the POST vars from Apache on a remote FreeBSD box?

The MicroEconomy submission form uses the POST method:
http://www.rapideuphoria.com/ecoform.htm

The corresponding CGI program (running on FreeBSD) is here:
http://www.rapideuphoria.com/economy.txt

POST is just a different way to transmit the query string.
The query string comes via standard input (file 0),
instead of via an environment string.
POST avoids creating a long, visible URL containing all the
form info. See procedure read_input()...

-- determine the query string
env = upper(getenv("REQUEST_METHOD"))
if equal(env, "POST") then
    -- "post" method
    nbytes = getenv("CONTENT_LENGTH")
    if atom(nbytes) then
        HTMLError("read_input - no CONTENT_LENGTH")
    end if
    nbytes = value(nbytes)
    if nbytes[1] = GET_SUCCESS then
        nbytes = nbytes[2]
    else
        HTMLError("read_input - bad CONTENT_LENGTH")
    end if
    query = get_bytes(0, nbytes)
else
     -- "get" method
    query = getenv("QUERY_STRING")  
    if atom(query) then
        HTMLError("read_input - no QUERY_STRING")
    end if
end if

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu