Introduction to programming for the Web:
We're going to start out with something small here. We'll just have a sample registration page
for creating users on our site.The prospective user enters his or her name, address and other details
and clicks on "register me" button on the browser. We are going to implement the whole process of
capturing this information and creating a user and sending an email back to the user informing whether
registration was accepted or not.
Let us suppose that we require only the following limited information to register a user:
User's Name
Login name
Email Address
The HTML for this page might resemble the following:
============================================
Registration Page
Please enter the following, to register
We can copy this and paste it in a file in caravan's document path. Let this file be named "register.html".
When you enter the url http://localhost/register.html in your browser location and press enter, you should
see this registration form. If you had copied this in the caravan's template path instead, there will be no
difference. You will see exactly the same thing. But internally caravan would have served it by running
the compiled code from memory. This is because any file with "html" extension in the template path is
automatically compiled by caravan at startup (and recompiled if modified at runtime). This page contains
no dynamically generated information and the compiled code probably just contains one instruction to
dump this entire page, stored as a string, from caravan's internal registers. So, a static document will
be cached in caravan's internal memory if it is located in the template path, though normally it is best to
put static documents in the document path -- it will not take up any memory this way.
Note : if we just copy any file in the template path at runtime it will not be active until caravan is
restarted -- you have to use the caravan's interface to make a new source file active at run time.
Let's go over this HTML carefully as there are a variety of tags that you may not be familiar with.
First, let's take a close look at the