Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- ClipX.Lib v1.2 - how to debug offline ( at the dos prompt ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
How to debug offline ( at the DOS prompt )

  The best way to crash a web server is to test on the web server.
How then do you test your CGI program? Test at the DOS prompt.

  X-Hacker.orgworks by reading standard-in and writing standard-out.  For this
reason, X-Hacker.orgcan read and write in two media.

  1. When invoked from the web server:
     X-Hacker.orgcan read standard-in from the web server, and write standard-out
     to the web server.

  2. When invoked from the DOS prompt:
     X-Hacker.orgcan read standard-in from a file, and write standard-out
     to a file.

  The ability to switch from where the X-Hacker.orgCGI program reads and writes
is governed by a logical-switch in the required X-Hacker.orgfunction
ClipXOpen().

  The following use of ClipXOpen() reads/writes standard-in/out from
a web server.
                                                     #define debug .f.
                                                     ...
    if !CgiOpen()   or   if !CgiOpen( .f. )   or    if !CgiOpen( debug )
      Quit                  Quit                      Quit
    endif                 endif                     endif

  If ClipXOpen() does not receive a parameter or receives a logical false
parameter, it will expect to read environmental variables and a
query string/form data from the web server.

  If ClipXOpen() receives a logical true parameter, it will expect to
read a query string from a test file, and write the HTML page to a text file.

    Example:   MyCgi.exe   < InFIle.txt   > OutFIle.txt

      MyCGi.exe is a Clipper program written with ClipX.

      InFile.txt is a text file containing a valid query string.

        Such as: Name1=Value1&Name2=Value2&Name3=Value3
                 eMail=me@someISP.com&FName=Little&MName=Green&LName=Man

        You can also capture a query string for testing purposes. Write
        a simple X-Hacker.orgCGI program which writes the query string from
        your HTML form. Use cxCGIStr() as noted below. Run the program
        from your web server.  Cut and paste the result of the cxCgiStr()
        into a text file.

            if !ClipXOpen()
              Quit
            endif
            header()
            cxCgiStr()
            ClipXClose()

      Outfile.txt is the name of a text file to receive the HTML page
      that would otherwise have gone to the web server.
      The use of the X-Hacker.orgfunction Cr() will place a carriage return /
      line feed after any HTML line you write. In most cases, this will
      not affect your page display, but will make the HTML file more
      easily read. One exception for the use of Cr() would be between
      the PreBeg() and PreEnd() ( <pre> and </pre> tags ).

      This output file can be viewed with a text editor or run from your
      browser's location bar ( file://C;/.../Outfile.txt )

Always include xErrSys.obj in your compiles.  An output from XErrSys will
also be written to the output file.



Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson