############################ file.h:

Create an object:

file Datei("test.txt",'w');

The first Parameter is the filename and the second one is the open mode to use. 
w - write
a - append
r - read
The class uses the C-function fcntl() to lock the file during editing. If the same programm 
runns more then one times, then only ONE process can write to the file. But don't believe
that nothing can happen! Every time a user could try to edit the file with vi - in this case
you can forget fcntl()!
You have been warned!

Methods:

string file::db_find(string reg_exp, char trenner, int search_field, int find_field)

Purpose: 	Search in a file containing lines separated in fields for a string
Variables:	string reg_exp - a string we are searching for
		char trenner - the separator betweeen fields
		int search_field - the field number where to search for reg_exp
		int find_field - the field we want to know (the result)
Returns:	A String containing the string in field number "int find_field"



 
int file::db_append(string row[], char trenner, int num_cols)

Purpose:	Append a line to a file. The line contains fields separated by "char trenner"
Variables:	string row[] - an array of strings conaining all fields
		char trenner - the separator
		int num_cols - how many fields (columns) the line counts
Returns:	0 (NULL) if everything was fine



int file::db_replace(string reg_exp, char trenner, int num_cols, int num_col_to_change, string new_val)

Purpose:	Replace a field in a file containing lines separated by "char trenner" with another
		string.
Variables:      string reg_exp - a string we are searching for
		char trenner - the separator betweeen fields
		int num_cols - how many fields (columns) the line counts
		int num_col_to_change - the field where we want to change the value
		string new_val - the new value for this field
Returns:        0 (NULL) if everything was fine



int file::err()

Purpose:	Returns the status of the current file
		if 0 is returned, it was successfull, otherwise not.




############################ html.h:

Create an Object:

html sample;

This Class is not very complicated, its methods are named like real html-tags, sometimes you can use it with some parameters



string HTML::html()

Purpose:	sends the string "<html>"



string HTML::_html()

Purpose:        sends the string "</html>"



string HTML::body()

Purpose:        sends the string "<body>"



string HTML::body(string bgcolor, string text, string link, string vlink, string alink)

Purpose:        sends the string "<body parameter=\"  \">"
Parameters:	string bgcolor - background color for the hole page
		string text - text color for the hole page
		string link - link color
		string vlink - visited link color
		string alink - active link



string HTML::body(string bgcolor)

Purpose:        sends the string "<body parameter=\"  \">"
Parameters:     string bgcolor - background color for the hole page  



string HTML::_body()

Purpose:	sends the string "</body>"



string HTML::title(string title)

Purpose:        sends the string "<title>"
Parameters:	string title - the title itself...


string HTML::hx(string title, string size)

Purpose:	sends the string "<h1...9>...</h1...9>"
Parameters:	string title - the header text
		string size - the size of the text, i.e. <H1> where 1 is the size



string HTML::font(string face, string size)

Purpose:	sends the <font> (start)tag
Parameters: 	string face - the face of the font, i.e. "arial"
		string size - the size



string HTML::_font()

Purpose:        sends the string "</font>"



string HTML::center()

Purpose:        sends the string "<center>"



string HTML::_center()

Purpose:        sends the string "</center>"



string HTML::table(string border, string bgcolor, string width)

Purpose:	table start tag
Parameters:	string border - the border size (zero if you don't want a border)
		string bgcolor - the table can have a background color
		string width - the width of the table, if you use absolute numbers, it means pixels
			if you do use the parameter with a "%" at the end of it - this means percent


string HTML::th(string colspan, string bgcolor)

Purpose:	sends table header tag



string HTML::th(string height)

Purpose:        sends table header tag 


string HTML::td(string bgcolor, string align, string valign)

Purpose:        sends the "<td>" tag, starts a table column
Parameters:	string bgcolor - the backgroung color
		string align - the horizontal alignment, either top, bottom or center
		string valign - the vertical alignment, either left, right or center



string HTML::td(string bgcolor, string align)

Purpose:        sends the "<td>" tag, starts a table column
Parameters:     string bgcolor - the backgroung color
                string align - the horizontal alignment, either top, bottom or center 



string HTML::td(string bgcolor)

Purpose:        sends the "<td>" tag, starts a table column
Parameters:     string bgcolor - the backgroung color   



string HTML::_table()

Purpose: 	sends the "</table>" tag - the end of a talbe



string HTML::tr()

Purpose:	sends the "<tr>" tag - start of a table row



string HTML::_tr()

Purpose:        sends the "</tr>" tag - end of a table row


 
string HTML::_th()

Purpose:	sends the "</th>" tag - the end of a table header



string HTML::td()

Purpose:        sends the "<td>" tag, starts a table column 



string HTML::_td()

Purpose:        sends the "</td>" tag - teh end of a table column



string HTML::_form()

Purpose:	sends the "</form>" tag - the end of a html form



string HTML::form(string name, string action, string method)

Purpose:	sends the "<form...>" tag - starts a html form
Parameters:	string name - the form name
		string action - the action assotiated with the form, this have to be a valid
			URL to an executable cgi-bin
		string method - the data transmission method, either POST or GET



string HTML::in_text(string name, string value)

Purpose:	used in a form, sends "<input type=text ...>" - a simple text field
Parameters:     string name - the input variable name
		string value - a value, may be nothing or a default value


string HTML::textarea(string name, string value, string row, string cols)

Purpose:	used in a form, sends "<input type=textarea...>" - a multilined textfield
Parameters:	string name - the input variable name 
		string value - a value, may be nothing or a default value 
		string row - the number of rows to use
		string cols - the number of columns to use



string HTML::textarea(string name, string value)

Purpose:        used in a form, sends "<input type=textarea...>" - a multilined textfield
Parameters:     string name - the input variable name
                string value - a value, may be nothing or a default value 



string HTML::in_password(string name, string value)

Purpose:	used in a form, sends "<input type=password...>" - a password input field,
		the input will be displayed as "*"
Parameters:	string name - the input variable name
                string value - a value, may be nothing or a default value 

string HTML::in_file(string name, string value)

Purpose:        used in a form, sends "<input type=file...>" - a file input field, used to
		upload files from a remote client
Parameters:     string name - the input variable name
                string value - a value, may be nothing or a default value 


string HTML::in_select(string name, string option[], string selected, int num)

Purpose:        used in a form, sends "<select ...>" - provides an option list
Parameters:	string name - the input variable name 
		string option[] - an array of strings to store the various options
		string selected - the optin which is selected by default
		int num - the number of options


string HTML::in_hidden(string name, string value)

Purpose:	sends a hidden variable back to the client
Parameters:     string name - the input variable name
                string value - the value


string HTML::in_submit(string value)

Purpose:	sends the SUBMIT Button
Parameters:	string value - the caption of the Button


string HTML::in_reset(string value)

Purpose:	sends the RESET Button
Parameters:     string value - the caption of the Button 



###################### cgi.h:

cgi::cgi(void) 

INTERNAL - the constructor



void cgi::get_all()

INTERNAL - get the form data from the remote client and strore them in an **char



string cgi::get_value(string form_name)

Purpose:	Retruns the value of a form variable(via the POST or GET Method)
Variables:	string form_name - the name of the form variable
Returns:	A string, completely parsed, ready for use. Maybe there are some "\n".



void cgi::getFormData(char** &formData,char** &formName,int &numItems) 

INTERNAL - the storage routine



void cgi::turnErrorPrintingOn(void) 

Currently unused



void cgi::turnErrorPrintingOff(void)

Currently unused



void cgi::initPage(char* location) 

Purpose:	Initializes the cgi object, retrieves the data, parses them and 
		stores everything in some vars. And it sends the line 
		"content-type: text/html\n\n\n" to the client.
Variables:	char* location - OPTIONAL! If no location is given, the appropriate 
		will be printed. If a location is given, then it sends a "Location: ..."
		to the client, so the Server output can be the contents of another website.
		This must be a valid URL.



string cgi::getRefer(void) 

Purpose:	returns the Server Environment Variable "Refer" as string



string cgi::getAgent(void)

Purpose:        returns the Server Environment Variable "Agent" as string



string cgi::getPragma(void)

Purpose:        returns the Server Environment Variable "Pragma" as string



string cgi::getAccept(void)

Purpose:        returns the Server Environment Variable "Accespt" as string



string cgi::getPath(void)

Purpose:        returns the Server Environment Variable "Path" as string



string cgi::getPathInfo(void)

Purpose:        returns the Server Environment Variable "PathInfo" as string



string cgi::getPathTranslated(void)

Purpose:        returns the Server Environment Variable "PathTranslated" as string



string cgi::getServerSoftware(void)

Purpose:        returns the Server Environment Variable "ServerSoftware" as string



string cgi::getServerNamer(void)

Purpose:        returns the Server Environment Variable "ServerNamer" as string



string cgi::getServerPort(void)

Purpose:        returns the Server Environment Variable "ServerPort" as string



string cgi::getRemoteHost(void)

Purpose:        returns the Server Environment Variable "RemoteHost" as string



string cgi::getRemoteAddress(void)

Purpose:        returns the Server Environment Variable "RemoteAdress" as string



string cgi::getGateway(void)

Purpose:        returns the Server Environment Variable "Gateway" as string



string cgi::getProtocol(void)

Purpose:        returns the Server Environment Variable "Protokoll" as string



const char* cgi::getRequestMethod(void)

Purpose:        returns the Server Environment Variable "RequestMethod" as string (POST || GET)



string cgi::getScriptName(void)

Purpose:        returns the Server Environment Variable "ScriptName" as string



const char* cgi::getQueryString(void)

INTERNAL:	Function to get the complete query string from the client, this is given to 
		other functions for parsing



string cgi::getSHLVL(void)

Purpose:        returns the Server Environment Variable "SHLVL" as string



string cgi::getPWD(void)

Purpose:        returns the Server Environment Variable "PWD" as string



string cgi::getLogName(void)

Purpose:        returns the Server Environment Variable "LogName" as string



string cgi::getUser(void)

Purpose:        returns the Server Environment Variable "User" as string



string cgi::getHost(void)

Purpose:        returns the Server Environment Variable "Host" as string



string cgi::getHostType(void)

Purpose:        returns the Server Environment Variable "HostType" as string



long cgi::getContentLength(void) 

INTERNAL:	Calculate the length of the query string as long




##################### mail.h:
Create an object:

mail MAIL;

There are some variables you have to set before you can send a message:

string SENDER:	REQUIRED. The sender of the message, it should be an adress, where the receipient
		can reply to!
string TO:	REQUIRED. The receipient of the message. Make sure, the adress is valid.
string BCC:	OPTIONAL. You can send the message per blind copy to another adress.
string CC:	OPTIONAL. You can send the message per carbon copy to another adress.
string SUBJECT: OPTIONAL. A subject for the message. If no subject was given, it will use:
		"Mail from CGI program"

Methods:

string Message:	OPTIONAL. If the string contains nothing, then nothing will be sent.


int mail::send()

Purpose:	Sends the Email message via sendmail. This must be installed 
		under /sbin/sendmail. If you have another location, please search this
		line and change it!
