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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--chtml include "//webinfo/incs/header.inc"-->

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.

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

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

    <body>
        <h1>CGI Data</h1>
        <!--chtml include "//webinfo/incs/navbar.inc"-->

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">
        <tr>
            <th>Variable</th>
            <th align="left">Value</th>
        </tr>
        <!--ENV_TABLE-->
    </table>

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>
    <!--DATA-->
    <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.

   	<!--DATA_KEYWORD-->
	       <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>
   	<!--/DATA_KEYWORD-->

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

    <table border="1">
	       <tr>
            <th>Key</th>
            <th align="left">Decoded Value</th>
        </tr>
	       <!--DATA_TABLE-->
    </table>
    <!--/DATA-->

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

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

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

    <!--chtml include "//webinfo/incs/footer.inc"-->
    </body>
</html>

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