[0001] [0002] [0003] [0004] [0005] [0006] [0007] [0008] [0009] [0010] [0011] [0012] [0013] [0014] [0015] [0016] [0017] [0018] [0019] [0020] [0021] [0022] [0023] [0024] [0025] [0026] [0027] [0028] [0029] [0030] [0031] [0032] [0033] [0034] [0035] [0036] [0037] [0038] [0039] [0040] [0041] [0042] [0043] [0044] [0045] [0046] [0047] [0048] [0049] [0050] [0051] [0052] [0053] [0054] [0055] [0056] [0057] [0058] [0059] [0060] [0061] [0062] [0063] [0064] [0065] [0066] [0067] [0068] [0069] [0070] [0071] [0072] [0073] [0074] [0075] [0076] [0077] [0078] [0079] [0080] [0081] [0082] [0083] [0084] [0085] [0086] [0087] [0088] [0089]
$!----------------------------------------------------------------------------- $! REQUEST_ERROR_MSG.COM $! $! Demonstrates various combinations of a script requesting the server $! generate an error message on it's behalf. $! Copy this into the server scripting directory (e.g. HT_ROOT:[CGI-BIN]) $! then access http://the.server.name/cgi-bin/request_error_msg $! $! 09-NOV-2002 MGD initial $!----------------------------------------------------------------------------- $ say = "write sys$output" $ if www_query_string .eqs. "" $ then $ say "Content-Type: text/html" $ say "" $ say "<HEAD>" $ say "<TITLE>REQUEST_ERROR_MSG.COM</TITLE>" $ say "</HEAD>" $ say "<HTML>" $ say "<B>Examples of script-requested, server-generated error messages.</B>" $ say "<P><FONT SIZE=-1>(Some components of these messages may not be " +- "generated depending on site error message configuration!)</FONT>" $ say "<FORM ACTION=""''www_script_name'"">" $ say "<P><INPUT TYPE=radio NAME=do VALUE=1 CHECKED>vanilla error message" $ say "<BR><INPUT TYPE=radio NAME=do VALUE=2>simple VMS status" $ say "<BR><INPUT TYPE=radio NAME=do VALUE=3>VMS status with file " +- "specification <I>(look at the HTML source of this message)</I>" $ say "<BR><INPUT TYPE=radio NAME=do VALUE=4>error message with module/line" $ say "<BR><INPUT TYPE=radio NAME=do VALUE=5>use only the first four selectors" $ say "<P><INPUT TYPE=submit VALUE=""Request Error Message"">" $ say "</FORM>" $ say "<FORM ACTION=""''www_script_name'"">" $ say "<P><INPUT TYPE=submit NAME=do VALUE=""Display This Procedure"">" $ say "</FORM>" $ say "</HTML>" $ exit $ endif $!---------------------------------------------------- $ if f$extract(0,7,f$element(1,"=",www_query_string)) .eqs. "Display" $ then $ say "Content-Type: text/plain" $ say "" $ type 'f$environment("procedure")' $ exit $ endif $!----------------------------------- $ if www_query_string .eqs. "do=1" $ then $ say "Status: 400" $ say "Script-Control: X-error-text=""Well actually it could! An example non-VMS status error message.""" $ say "" $ exit $ endif $!----------------------------------- $ if www_query_string .eqs. "do=2" $ then $ say "Status: 500" $ say "Script-Control: X-error-text=""a VMS status value generated report (REALLY!)""" $ say "Script-Control: X-error-vms-status=676" $ say "" $ exit $ endif $!----------------------------------- $ if www_query_string .eqs. "do=3" $ then $ say "Status: 000 (allows the server to generate it's own HTTP status code)" $ say "Script-Control: X-error-text=""/this/file/does/not.exist""" $ say "Script-Control: X-error-vms-status=%X00000910" $ say "Script-Control: X-error-vms-text=""THIS:[FILE.DOES]NOT.EXIST""" $ say "" $ exit $ endif $!----------------------------------- $ if www_query_string .eqs. "do=4" $ then $ say "Status: 403" $ say "Script-Control: X-error-text=""This message specifies the META module and line (check the HTML source).""" $ say "Script-Control: X-error-module=REQUEST_ERROR_MSG; X-error-line=999" $ say "Content-Type: text/html" $ say "" $ say "<!-- this is just ignored by WASD -->" $ say "<b>ERROR 403:</b> For other, less capable server environments :^)" $ exit $ endif $!----------------------------------- $ say "Status: 400" $ say "Script-Control: X-error-text=""Difficult to tell the difference, isn't it?""" $ say "" $!-----------------------------------------------------------------------------