Паскаль / do9 / iriepas201 / Irie Pascal / samples / cgiinfo
.pasprogram info(output); procedure WriteHeader; begin writeln('Content-type: text/html'); writeln; writeln(''); writeln(''); writeln('Irie Pascal sample CGI application'); writeln('This program displays the contents of all CGI environment variables.'); writeln('') end; procedure WriteBody; procedure DisplayEnvVar(name : string); var value : string; begin value := getenv(name); writeln(name, ' = ', value, '
') end; begin writeln(''); DisplayEnvVar('HTTP_ACCEPT'); DisplayEnvVar('HTTP_ACCEPT_ENCODING'); DisplayEnvVar('HTTP_ACCEPT_LANGUAGE'); DisplayEnvVar('HTTP_AUTHORIZATION'); DisplayEnvVar('HTTP_CHARGE_TO'); DisplayEnvVar('HTTP_FROM'); DisplayEnvVar('HTTP_IF_MODIFIED_SINCE'); DisplayEnvVar('HTTP_PRAGMA'); DisplayEnvVar('HTTP_REFERER'); DisplayEnvVar('HTTP_USER_AGENT'); writeln(''); DisplayEnvVar('AUTH_TYPE'); DisplayEnvVar('CONTENT_LENGTH'); DisplayEnvVar('CONTENT_TYPE'); DisplayEnvVar('GATEWAY_INTERFACE'); DisplayEnvVar('PATH_INFO'); DisplayEnvVar('PATH_TRANSLATED'); DisplayEnvVar('QUERY_STRING'); DisplayEnvVar('REMOTE_ADDR'); DisplayEnvVar('REMOTE_HOST'); DisplayEnvVar('REMOTE_IDENT'); DisplayEnvVar('REMOTE_USER'); DisplayEnvVar('REQUEST_METHOD'); DisplayEnvVar('SCRIPT_NAME'); DisplayEnvVar('SERVER_NAME'); DisplayEnvVar('SERVER_PORT'); DisplayEnvVar('SERVER_PROTOCOL'); DisplayEnvVar('SERVER_SOFTWARE'); writeln('') end; procedure WriteFooter; begin writeln('') end; begin WriteHeader; WriteBody; WriteFooter end.