$! $! Dick Munroe (munroe@csworks.com) $! $! The following is a "server neutral" CGI that runs under the $! following HTTP server environments: $! $! 1. OSU $! 2. WASD using OSU emulation $! 3. WASD using (sub)processes. $! $! Use is simple, just put the code where indicated and go from $! there. When direct interaction with the HTTP server is $! necessary, use SAY which will direct the output to the $! appropriate spot. $! $ $ theDecnetFlag = (f$type(wwwexec_rundown_string) .nes. "") $ if (theDecnetFlag) $ then $ nl = f$fao("!/") ! CR/LF sequence $ say = "write net_link" $ say "" ! Set implied carriage control. $ cgisymbols := $cgi-bin:[000000]cgi_symbols.exe $ cgisymbols "www_" "form_" $ else $ say = "write sys$output" $ cgiutl := $cgi-bin:[000000]cgiutl.exe $ cgiutl /URLDECODE /SYMBOL /PREFIX=form_FLD $ endif $ $ theOSUFlag = (f$extract(0,3,www_server_software) .eqs. "OSU") $ theVerifyFlag = (f$trnlnm("httpd$verify") .nes. "") $ theWASDFlag = (f$extract(0,10,www_server_software) .eqs. "HTTPd-WASD") $ if (theWASDFlag) .and. (.not. theVerifyFlag) $ then $ set message /nofacility /noidentification /noseverity /notext $ endif $ if (theVerifyFlag) $ then $ if (theDecnetFlag) $ then $ say "Content-type: text/plain",nl,nl $ define sys$output net_link: $ set verify $ endif $ show symbol/global/all $ show symbol/local/all $ endif $ $! The CGI code goes here. $ $ exit $ $! $! If a "Location" header is needed, call this routine. $! $ $ Location: subroutine $ if (theDecnetFlag) $ then say "Location: " + P1,nl,nl $ else cgiutl /location=*p1 $ endif $ exit $ endsubroutine