1. Aku, Your ambilPost() Function

Aku!!! Why did you do this to me?

In your ambilPost() function you've got this code:

if atom(lenq) or length(lenq) < 1 then
    qs = no10(gets(0)) --<-- look here
else
    qs = get_bytes(0,val(lenq))
end if

Why do you wait for a keystroke (ENTER) here when it's supposed to be 
processing a web page?!?! :)

Anyway, you might want to change that.

-ck

new topic     » topic index » view message » categorize

2. Re: Aku, Your ambilPost() Function

CKL> Aku!!! Why did you do this to me?

CKL> In your ambilPost() function you've got this code:

CKL> if atom(lenq) or length(lenq) < 1 then
CKL>     qs = no10(gets(0)) --<-- look here
CKL> else
CKL>     qs = get_bytes(0,val(lenq))
CKL> end if

CKL> Why do you wait for a keystroke (ENTER) here when it's supposed to be
CKL> processing a web page?!?! :)

CKL> Anyway, you might want to change that.

I think it doesn't have to be a keystroke, but a '\n'.
But actually this is the flow:

global procedure ambilPost()

    -- get the length of the input, will be set by HTTP server
    lenq = getenv("CONTENT_LENGTH")

    -- if the CONTENT_LENGTH is not set,
    if atom(lenq) or length(lenq) < 1 then
        qs = no10(gets(0))
        
    -- but in normal case, this code will be executed.
    else
        qs = get_bytes(0, val(lenq))
    end if
    
    parse()
end procedure

I made this so that you can use the cgi program in 2 methods:

1. The normal method: the script is executed by the HTTP server,
   it will set the CONTENT_LENGTH variable and feed the input via the
   stdin (fn = 0).

2. Manual method: you execute the script yourself (exu ./script.exu)
   so the CONTENT_LENGTH variable is not set, and you type the
   parameters yourself, followed by an Enter key (hence the gets(0)).
   - For example:
     [user at domain]$ exu ./script.exu
     name=me&age=12<press enter here>
     
     so the variable qs (see above) will contain "name=me&age=12"


Sorry for not stating this.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Aku, Your ambilPost() Function

How is it? I have replied this but there is no response from you. Did
my mail delivered sucessfully?

CKL> Aku!!! Why did you do this to me?

CKL> In your ambilPost() function you've got this code:

CKL> if atom(lenq) or length(lenq) < 1 then
CKL>     qs = no10(gets(0)) --<-- look here
CKL> else
CKL>     qs = get_bytes(0,val(lenq))
CKL> end if

CKL> Why do you wait for a keystroke (ENTER) here when it's supposed to be
CKL> processing a web page?!?! :)

CKL> Anyway, you might want to change that.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Aku, Your ambilPost() Function

> How is it? I have replied this but there is no response from you. Did
> my mail delivered sucessfully?

So far I'm cheating it, I think... like this:

if atom(lenq) or length(lenq) < 1 then
    -- qs = no10(gets(0)) --<-- I comment this line out
    qs = "" -- and return this
else
    qs = get_bytes(0,val(lenq))
end if

I think it gets to that point because there are no parameters sent, but I
don't know for sure. :/

The gets(0) problem was halting the serving of HTML pages waiting for a
<RETURN>. At least, that's what it looks like to me.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu