$!----------------------------------------------------------------------------+ $! REDIRFORM - Redirects from a form with a field called "URL" to that URL | $!----------------------------------------------------------------------------+ $! The posted form *must* use the field name "URL" for the URL to use. $! $ SET NOON $ PUT = "WRITE NET_LINK" $ PUT "" ! Set implied carriage control. $ CGI_SYMBOLS "WWW_" "FORM_" ! Define symbols $ IF "''WWW_HTTP_USER_AGENT'" .EQS. "" THEN WWW_HTTP_USER_AGENT = "Other" $! $ IF "''FORM_FLD_URL'" .EQS. "" THEN FORM_FLD_URL = "http://www.memphis.edu/" $ PUT "content-type: text/html" ! Put a URL in the body for bad clients $ IF F$ELEMENT(0,"/",WWW_HTTP_USER_AGENT) .EQS. "Mozilla" $ THEN PUT "status: 302 Temp Redirect" ! 302 Redirect for Netscape $ ELSE PUT "status: 303 See Other" ! 303 Redirect for good clients $ ENDIF ! For more info about why the kludge for Netscape, see below. $ PUT "location: " + FORM_FLD_URL ! to here $ PUT "" ! End the header $ IF WWW_REQUEST_METHOD .EQS. "HEAD" THEN EXIT $ PUT "Your browser doesn't support redirection. Please select the" $ PUT "Chosen URL." $ EXIT ! No more to do $! $! 4/17/1997 - Netscape Kludge Information $! According to HTTP 1.1, a 303 status should be sent for what is being $! done here. Both Lynx and Internet Explorer work correctly with a 303, $! but the latest versions (3.x and 4.0 beta) of Netscape don't, so I'm $! just sending a 302 for Mozilla. Netscape *also* doesn't honor the $! text/html content type for the response, so the standard fall-back $! of placing the link in the body and allowing manual selection doesn't $! work either! I still include it for browsers which work correctly $! but don't understand 303 (which is allowed by the standard). IE also $! reports itself as Mozilla, so it's stuck with bug compatibility mode.