web appication

web appication

Postby kajot » Fri Nov 14, 2008 6:13 pm

is possible to create web application with FWH ?
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Postby Antonio Linares » Fri Nov 14, 2008 8:45 pm

FWH is a GUI library for the desktop, not for the web.

You can use Harbour/xHarbour to create CGI applications, that will run from a web server.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby kajot » Sat Nov 15, 2008 6:30 am

same samples
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Postby Antonio Linares » Sat Nov 15, 2008 8:30 am

Kajot,

What web server do you plan to use ?

Windows ? Linux ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby kajot » Sat Nov 15, 2008 2:18 pm

Microsoft SERVER IIS
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Postby kajot » Sat Nov 15, 2008 2:22 pm

or Apache
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Postby Silvio » Sat Nov 15, 2008 2:41 pm

Antonio ,
Also I should like to make a small cgi application
i have windows and i not found samples on mine cds
installation package.
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Antonio Linares » Sat Nov 15, 2008 3:24 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby kajot » Sat Nov 15, 2008 5:14 pm

any samples with using Harbour/xHarbour to create CGI applications
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Postby kajot » Sat Nov 15, 2008 5:55 pm

any samples with using Harbour/xHarbour to create CGI applications
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Postby kajot » Sat Nov 15, 2008 6:30 pm

or Apache
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Postby Enrico Maria Giordano » Sat Nov 15, 2008 9:03 pm

Code: Select all  Expand view
#include "Simpleio.ch"


FUNCTION MAIN()

    ?? [Content-type: text/html]
    ?
    ? [<HTML>]
    ? [<HEAD>]
    ? [<BODY>]
    ? [Param = ] + GETVAR( "Param" )
    ? [</BODY>]
    ? [</HTML>]

    RETURN NIL


STATIC FUNCTION GETVAR( cVar )

    LOCAL nLen, nPos, nSta, nEnd

    STATIC cString

    IF cString = NIL
        nLen = VAL( GETENV( "CONTENT_LENGTH" ) )

        IF nLen > 0
            cString = SPACE( nLen )
            FREAD( 0, @cString, nLen )
        ELSE
            cString = GETENV( "QUERY_STRING" )
        ENDIF
    ENDIF

    IF EMPTY( cString ); RETURN ""; ENDIF

    nPos = AT( cVar, cString )

    IF nPos != 0
        nSta = nPos + LEN( cVar ) + 1
        nEnd = AT( "&", SUBSTR( cString, nSta ) )

        IF nEnd = 0
            RETURN DECODE( SUBSTR( cString, nSta ) )
        ELSE
            RETURN DECODE( SUBSTR( cString, nSta, nEnd - 1 ) )
        ENDIF
    ELSE
        RETURN ""
    ENDIF

    RETURN NIL   


STATIC FUNCTION DECODE( cString )

    LOCAL cResult := ""
    LOCAL i

    FOR i = 1 TO LEN( cString )
        IF SUBSTR( cString, i, 1 ) = "+"
            cResult += " "
        ELSEIF SUBSTR( cString, i, 1 ) = "%"
            cResult += HEX2CHR( SUBSTR( cString, i + 1, 2 ) )
            i += 2
        ELSE
            cResult += SUBSTR( cString, i, 1 )
        ENDIF
    NEXT

    RETURN cResult


STATIC FUNCTION HEX2CHR( cHex )

    LOCAL cHigh := UPPER( SUBSTR( cHex, 1, 1 ) )
    LOCAL cLow  := UPPER( SUBSTR( cHex, 2, 1 ) )
    LOCAL nHigh, nLow

    IF ISDIGIT( cHigh )
        nHigh = ASC( cHigh ) - 48
    ELSE
        nHigh = ASC( cHigh ) - 55
    ENDIF

    IF ISDIGIT( cLow )
        nLow = ASC( cLow ) - 48
    ELSE
        nLow = ASC( cLow ) - 55
    ENDIF

    RETURN CHR( nHigh * 16 + nLow )


#include "Error.ch"


FUNCTION ERRORSYS()

    ERRORBLOCK( { | e | DefError( e ) } )

    RETURN NIL


STATIC FUNCTION DEFERROR( e )

    DO CASE
        CASE e:GenCode = EG_OPEN .AND. ( e:OsCode = 32 .OR. e:OsCode = 5 ) .AND. e:CanDefault
            NETERR( .T. )
            RETURN .F.
        CASE e:GenCode = EG_APPENDLOCK .AND. e:CanDefault
            NETERR( .T. )
            RETURN .F.
        OTHERWISE
            ERRORMESSAGE( e )
            QUIT
    ENDCASE

    RETURN NIL


STATIC FUNCTION ERRORMESSAGE( e )

    LOCAL cMessage

    LOCAL n := 3

    // Start error message
    cMessage = IF( e:Severity > ES_WARNING, "Error ", "Warning " )

    // Add subsystem name if available
    IF VALTYPE( e:SubSystem ) = "C"
        cMessage += e:SubSystem
    ELSE
        cMessage += "???"
    ENDIF

    // Add subsystem's error code if available
    IF VALTYPE( e:SubCode ) = "N"
        cMessage += "/" + LTRIM( STR( e:SubCode ) )
    ELSE
        cMessage += "/???"
    ENDIF

    // Add error description if available
    IF VALTYPE( e:Description ) = "C"
        cMessage += "  " + e:Description
    ENDIF

    // Add either filename or operation
    IF !EMPTY( e:Filename )
        cMessage += ": " + e:Filename
    ELSEIF !EMPTY( e:Operation )
        cMessage += ": " + e:Operation
    ENDIF

    // Add function name and line number
    IF EMPTY( PROCLINE( n ) )
        n++
    ENDIF

    cMessage += ";Function: " + PROCNAME( n ) + "  Line: " + LTRIM( STR( PROCLINE( n ) ) )

    ?? [Content-type: text/html]
    ?
    ? [<HTML>]
    ? [<BODY>]
    ? cMessage
    ? [</BODY>]
    ? [</HTML>]

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 94 guests