home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 8
/
amigaformatcd08.iso
/
in_the_mag
/
html_tutorial
/
mas_cvo.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-09-03
|
2KB
|
50 lines
#include <iostream.h>
#include <stdlib.h>
inline void html( char str[] ) { cout << str << "\n"; }
inline void html_( char str[] ) { cout << str; }
inline void html_( char c ) { cout << c; }
// Debug option to deliver
// environment variables seen by the script
char* getenv_n( char var[] )
{
char *p = getenv( var );
return p == NULL ? "[]" : p;
}
void cgi_var_output( )
{
html( "<PRE>" );
html_("AUTH_TYPE "); html( getenv_n( "AUTH_TYPE" ) );
html_("CONTENT_LENGTH "); html( getenv_n( "CONTENT_LENGTH" ) );
html_("CONTENT_TYPE "); html( getenv_n( "CONTENT_TYPE" ) );
html_("GATEWAY_INTERFACE "); html( getenv_n( "GATEWAY_INTERFACE" ) );
html_("HOSTTYPE "); html( getenv_n( "HOSTTYPE" ) );
html_("HTTP_ACCEPT "); html( getenv_n( "HTTP_ACCEPT" ) );
html_("HTTP_CONNECTION "); html( getenv_n( "HTTP_CONNECTION" ) );
html_("HTTP_HOST "); html( getenv_n( "HTTP_HOST" ) );
html_("HTTP_PRAGMA "); html( getenv_n( "HTTP_PRAGMA" ) );
html_("HTTP_REFERER "); html( getenv_n( "HTTP_REFERER" ) );
html_("HTTP_USER_AGENT "); html( getenv_n( "HTTP_USER_AGENT" ) );
html_("OSTYPE "); html( getenv_n( "OSTYPE" ) );
html_("PATH_INFO "); html( getenv_n( "PATH_INFO" ) );
html_("PATH_TRANSLATED "); html( getenv_n( "PATH_TRANSLATED" ) );
html_("QUERY_STRING "); html( getenv_n( "QUERY_STRING" ) );
html_("REMOTE_ADDR "); html( getenv_n( "REMOTE_ADDR" ) );
html_("REMOTE_HOST "); html( getenv_n( "REMOTE_HOST" ) );
html_("REMOTE_IDENT "); html( getenv_n( "REMOTE_IDENT" ) );
html_("REMOTE_USER "); html( getenv_n( "REMOTE_USER" ) );
html_("REQUEST_METHOD "); html( getenv_n( "REQUEST_METHOD" ) );
html_("SCRIPT_NAME "); html( getenv_n( "SCRIPT_NAME" ) );
html_("SERVER_NAME "); html( getenv_n( "SERVER_NAME" ) );
html_("SERVER_PORT "); html( getenv_n( "SERVER_PORT" ) );
html_("SERVER_PROTOCOL "); html( getenv_n( "SERVER_PROTOCOL" ) );
html_("SERVER_SOFTWARE "); html( getenv_n( "SERVER_SOFTWARE" ) );
html( "</PRE>" );
}