cgitest.tmpl Annotated Source

This is the template used by cgitest.cgi to generate output. It is read in by the script, processed by chtml, then special tags are replaced by script-generated data.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Transitional//EN" "">
<!--chtml include "//webinfo/incs/"-->

The first things in the file identify this page as XHTML 1.0 Transitional.

The chtml command is at the beginning of all pages in the webinfo directory. It defines variables, and is a place where other site-wide definitions can be made.

        <title>CGI Data</title>
        <link rel="stylesheet" href="/webinfo/webinfo.css" type="text/css">

The head of the document, which just defines the title and links to the webinfo stylesheet.

        <h1>CGI Data</h1>
        <!--chtml include "//webinfo/incs/"-->

The start of the document's body. After the title section of the document, the webinfo navigation bar is defined. Note that each directory specifies a segment to add to the navigation bar.

    <h2>Environment Variables</h2>
    <table border="1">
            <th align="left">Value</th>

This table shows the environment variables, including the CGI variables. the ENV_TABLE comment is what the script will use as a marker for where the data should go.

    <h2>Query Information</h2>
    <p>Data submitted</p>

If data is submitted, then the HTML between DATA and /DATA will be displayed. First, we indicate that we did see data.

	       <p>(note that if you submitted a query string and not data, it
	       will show up as the value of the key <kbd>keywords</kbd>)</p>

If the arguments do not look like form data, then we let the user know how to interpret the information.

    <table border="1">
            <th align="left">Decoded Value</th>

We then create a table to show all the input, which replaces the DATA_TABLE comment.

    <p>Make this CGI the <kbd>ACTION</kbd> for your HTML form to	show the input variables.</p>

If there is no data, then the segment of HTML between DATA_NOVAL and /DATA_NOVAL is displayed.

    <!--chtml include "//webinfo/incs/"-->

This finishes up the template, including the standard webinfo footer.