<BLOCK body>

# The Tutorial

This tutorial should help you with the first steps in htp. This tutorial assumes that you are already somewhat familiar with HTML. You can find good HTML tutorials on the web, e.g. at the W3Schools. If you speak german, spanish, french or japanese, you should take a look at SELFHTML.

On this and the following pages we want to give you an idea of how htp is used. If you read this the first time you should not follow the links to the reference manual.

## Writing simple htp files

In their simplest form htp files are just ordinary html files. In that case the htp process just copies the file. However, there are some features of htp makes live easier. Let's have a look at a simple example:

This page was produced by htp.

Copyright by <use author>, <use email>, last updated <file date>

You can download the file tut1.htp and put it into an empty directory. Then you can invoke htp from the command line (e.g. from the DOS box) like this:

    htp tut1.htp tut1.html

This creates a file tut1.html, your first html file produced by htp.

In line 1 we use a special tag named `set`. Even though this looks like an html tag it is really an htp tag. When htp reads the set tag, it doesn't copy it over to the html file. Instead it defines the macro `author` and bind the value `Joe Doe` to it. This macro is later expanded in line 6 and line 12, to retrieve the author name again.

The advantage of using macros is obvious if you consider the email macro in line 2 and 13. Normally, you need to type the email twice, once in the `href` attribute and once to show up on the page. If you have a typo in the `href` tag you probably won't notice it. With the use of macros you only have to type the email once. Also you have to update only one place when your email address changes.

As you can see there are two ways to get the value, which is bound to a macro: One is the `use` tag in line 12. This tag is replaced by htp with the contents of the macro, `Joe Doe` in this case. However, if the macro needs to be expanded inside an html or htp tag, you can't nest a `use` tag. Instead the "$" character followed by the macro name can be used as shown in lines 6 and 13.

In line 14 you can see another special htp tag, the `file` tag. This tag has many functions, however, in this case it is just used to get the modification date of the current htp file.

In the next section of this tutorial we show you how to use htp in big projects where you have many web pages that should get a similar layout.

Go to the next section

</BLOCK>