HMG And The Web (Part III)...

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

Post Reply
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

HMG And The Web (Part III)...

Post by Roberto Lopez »

And now... The Real Thing:

Lets imagine this scenario:

We have a HMG application using DBF files.

This application is being used across the office LAN by various users.

The problem is that you need that the data, and (at least) part of the application be available via Internet in non-Windows clients running standard web browsers.

You must be able to query and modify the dbf tables via Internet web clients, concurrently with office LAN users.

The good news is that the remote web clients, only need basic queries and data entry functionality.

Of course, our time is very limited :)

After various days of research and tests my first winner was the following:

In the harbour examples folder there is an interesting application called 'httpsrv'.

This is an http server capable of execute .hrb modules at client browser requests.

To make it work you must compile the server and the modules.

If you put attention on the 'testajax.prg' and 'testajax.html' files you'll notice how simple the things are.

Looking at the module you'll see that putting something in a web page is so easy as returning the required string in a module like this:

Code: Select all

#include "common.ch"

MEMVAR _REQUEST

FUNCTION HRBMAIN()
   LOCAL cW
   LOCAL cHtml := ""

   IF HB_HHasKey( _REQUEST, "w" )
      IF !Empty( cW := _REQUEST[ "w" ] )
         cHtml += "This is a reply from testajax : " + cW
      ENDIF
   ENDIF

RETURN cHtml

Where cW is the received parameter that is returned to the client unmodified on this example.

To make the development faster on this environment, you should create generic modules for record append, modify, delete and query.

PROS: You can share your current dbf files with web clients (you shouldn't touch your existing app).

CONS: You must take care of the security, creating a session in such way to not require to the user to send his user name and password for each module execution.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: HMG And The Web (Part III)...

Post by esgici »

Hello Roberto

Everything become clear when you explain :D

Fortunately, you are here :D

Hearty thanks and best regards :D

Saludos cordiales :D

--

Esgici
Viva INTERNATIONAL HMG :D
Post Reply