Little test AP functions

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!
Post Reply
User avatar
Otto
Posts: 6403
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 22 times
Been thanked: 2 times
Contact:

Little test AP functions

Post by Otto »

Little test AP functions

Code: Select all | Expand


function main
    local cTest := "my Test"
   
    ? "--------------------------------------"
    ? "AP_Body()  Returns the request body as a string"
    ? AP_Body()
    ? "--------------------------------------"
   
    ? 'AP_Method()  returns "GET" or "POST" according to the client request'
    ? AP_Method()
    ? "--------------------------------------"
   
    ? "AP_FileName() --> cFileName  returns the filename.prg provided to Apache by the client"
    ? ValToChar(AP_FileName())
    ? "--------------------------------------"
   
    ? "AP_GetPairs() --> Hash   returns a hash with all GET pairs, key and value "
    ? ValToChar(AP_GetPairs())
    ? "--------------------------------------"
   
    ? "AP_Args() --> cArgs  returns the args provided to Apache by the client if any "
    ? ValToChar( AP_Args() )
    ? "--------------------------------------"
   
   
    TEMPLATE PARAMS cTest
    <!DOCTYPE html>
    <html>
    <head>
    </head>
    <body>
    <h1>This is a heading</h1>
    <p>This is a paragraph.</p>
    <a href="#?test=<?prg return cTest ?>">Pasa variable <?prg return cTest ?></a>
    </body>
    </html>
   
ENDTEXT

return

//----------------------------------------------------------------------------//

 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Antonio Linares
Site Admin
Posts: 42513
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: Little test AP functions

Post by Antonio Linares »

Dear Otto,

You may add:

AP_PostPairs() --> Hash returns a hash with all POST pairs, key and value

More:
https://github.com/FiveTechSoft/mod_harbour/wiki/Functions-provided-by-the-mod-Harbour
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 6403
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 22 times
Been thanked: 2 times
Contact:

Re: Little test AP functions

Post by Otto »

Dear Antonio,
Thank you. I add it.
I made a little program with mod harbour - GENESIS - and TINY document management. Text is stored to DBF file.
Furthermore, I use this now for documenting mod development.
When I have the HTML viewer ready. I will put online the link to this knowledge base.

Although you made it straightforward for us, there is still a lot to learn and discover and to remember. Therefore, I write it down for me.
Thank you again for mod harbour.

Best regards and have a nice Sunday
Otto


Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Post Reply