home *** CD-ROM | disk | FTP | other *** search
/ PC Press 1998 September / Sezamfile98_2.iso / VBasic / VB5-CGI.ZIP / demoCGI.ba_ / demoCGI.ba
Text File  |  1998-06-08  |  2KB  |  31 lines

  1. Attribute VB_Name = "modCGI"
  2. 'VB5-CGI Objects script example: demoCGI.bas
  3. 'Copyright 1997, 1998 EazyWare - http://www.eazyware.com/vb5-cgi
  4. '---------------------------------------------------------------
  5. 'Shows the basic functionalities of the VB5CGI object.
  6. '---------------------------------------------------------------
  7.  
  8. Option Explicit
  9. Private CGI As New VB5CGI.clsCGI                'Instance the VB5CGI Object (needs VB5CGI.DLL)
  10.  
  11. Sub Main()
  12. Dim msg As String                               'String variable for HTML text
  13.     
  14.     With CGI                                    'We use the VB5CGI object
  15.         .DebugLogMode = cgiDebugAll             'Enable debugging to file CGIdebug.log
  16.         If Len(.GetQueryString) > 0 Then        'Did we receive a Query String?
  17.             .SetCookie "Name1", "Value1"        'Send the first cookie
  18.             .SetCookie "Name2", "Value2"        'Send the second cookie
  19.             msg = "<HTML><TITLE>VB5HTML demonstration [" & .GetScriptName(True) & "]</TITLE>" & _
  20.                   "<BODY>The Query String you sent with the " & .EnvRequestMethod & _
  21.                   " method is: " & .GetQueryString() & "<BR><P>" & _
  22.                   "If you allow cookies, the second cookie value will be next time: " & _
  23.                   .GetCookieValue("Name2") & "<BR><P>" & _
  24.                   "Page access: " & .GetHitCounterInc(App.EXEName) & "</BODY></HTML>"
  25.             .StdOutput .GetHTTPHeader & msg     'Submit the page with the HTTP-header
  26.         Else
  27.             .DumpEnvInfo                        'Dump the environment variables and VB5CGI information
  28.         End If
  29.     End With
  30. End Sub
  31.