home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 8
/
amigaformatcd08.iso
/
in_the_mag
/
html_tutorial
/
mas_view.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-09-03
|
2KB
|
61 lines
// (C) M.A.Smith University of Brighton
//
// Permission is granted to use this code
// provided this declaration and copyright notice remains intact.
//
// 26 August 1995
#include <iostream.h>
#include <fstream.h>
#include <iomanip.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
void cgi_var_output();
char* getenv_n( char [] );
// Main program
//
int main()
{
cgi_var_output();
return 0;
}
void cgi_var_output( )
{
cout << "Content-type: text/html" << "\n"
<< "\n" << "\n" << "<PRE>" << "\n";
cout << "AUTH_TYPE " << getenv_n( "AUTH_TYPE" ) << "\n";
cout << "CONTENT_LENGTH " << getenv_n( "CONTENT_LENGTH" ) << "\n";
cout << "CONTENT_TYPE " << getenv_n( "CONTENT_TYPE" ) << "\n";
cout << "GATEWAY_INTERFACE " << getenv_n( "GATEWAY_INTERFACE" ) << "\n";
cout << "HTTP_ACCEPT " << getenv_n( "HTTP_ACCEPT" ) << "\n";
cout << "HTTP_REFERER " << getenv_n( "HTTP_REFERER" ) << "\n";
cout << "HTTP_USER_AGENT " << getenv_n( "HTTP_USER_AGENT" ) << "\n";
cout << "PATH_INFO " << getenv_n( "PATH_INFO" ) << "\n";
cout << "PATH_TRANSLATED " << getenv_n( "PATH_TRANSLATED" ) << "\n";
cout << "QUERY_STRING " << getenv_n( "QUERY_STRING" ) << "\n";
cout << "REMOTE_ADDR " << getenv_n( "REMOTE_ADDR" ) << "\n";
cout << "REMOTE_IDENT " << getenv_n( "REMOTE_IDENT" ) << "\n";
cout << "REMOTE_HOST " << getenv_n( "REMOTE_HOST" ) << "\n";
cout << "REMOTE_USER " << getenv_n( "REMOTE_USER" ) << "\n";
cout << "REQUEST_METHOD " << getenv_n( "REQUEST_METHOD" ) << "\n";
cout << "SCRIPT_NAME " << getenv_n( "SCRIPT_NAME" ) << "\n";
cout << "SERVER_NAME " << getenv_n( "SERVER_NAME" ) << "\n";
cout << "SERVER_PORT " << getenv_n( "SERVER_PORT" ) << "\n";
cout << "SERVER_PROTOCOL " << getenv_n( "SERVER_PROTOCOL" ) << "\n";
cout << "SERVER_SOFTWARE " << getenv_n( "SERVER_SOFTWARE" ) << "\n";
cout << "</PRE>" << "\n";
}
char* getenv_n( char var[] )
{
char *p = getenv( var );
return p == NULL ? "[]" : p;
}