Little test AP functions

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

Little test AP functions

Postby Otto » Tue Jan 04, 2022 8:10 am

Little test AP functions
Code: Select all  Expand view

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
Otto
 
Posts: 6091
Joined: Fri Oct 07, 2005 7:07 pm

Re: Little test AP functions

Postby Antonio Linares » Sat Jan 08, 2022 9:09 am

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
Antonio Linares
Site Admin
 
Posts: 41436
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Little test AP functions

Postby Otto » Sat Jan 08, 2022 4:05 pm

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
********************************************************************
User avatar
Otto
 
Posts: 6091
Joined: Fri Oct 07, 2005 7:07 pm


Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 4 guests