Attribute VB_Name = "modCGI" 'VB5-CGI Objects script example: demoCGI.bas 'Copyright 1997, 1998 EazyWare - http://www.eazyware.com/vb5-cgi '--------------------------------------------------------------- 'Shows the basic functionalities of the VB5CGI object. '--------------------------------------------------------------- Option Explicit Private CGI As New VB5CGI.clsCGI 'Instance the VB5CGI Object (needs VB5CGI.DLL) Sub Main() Dim msg As String 'String variable for HTML text With CGI 'We use the VB5CGI object .DebugLogMode = cgiDebugAll 'Enable debugging to file CGIdebug.log If Len(.GetQueryString) > 0 Then 'Did we receive a Query String? .SetCookie "Name1", "Value1" 'Send the first cookie .SetCookie "Name2", "Value2" 'Send the second cookie msg = "VB5HTML demonstration [" & .GetScriptName(True) & "]" & _ "The Query String you sent with the " & .EnvRequestMethod & _ " method is: " & .GetQueryString() & "

" & _ "If you allow cookies, the second cookie value will be next time: " & _ .GetCookieValue("Name2") & "

" & _ "Page access: " & .GetHitCounterInc(App.EXEName) & "" .StdOutput .GetHTTPHeader & msg 'Submit the page with the HTTP-header Else .DumpEnvInfo 'Dump the environment variables and VB5CGI information End If End With End Sub