Apache-ASP
view release on metacpan or search on metacpan
site/articles/perlmonth2_build.html view on Meta::CPAN
<html>
<head><title>Apache::ASP Site Building</title></head>
<bgcolor=white>
<h2>Apache::ASP Site Building</h2>
<h3>By: Joshua Chamas</h3>
<i>published originally in PerlMonth.com in 1999</i>
<p>
Last month,
I gave a rough introduction of <a href=http://www.apache-asp.org/>Apache::ASP</a>,
and why you might want to use it to build your web site.
Now I get to show you Apache::ASP in action.
<h3>Requirements</h3>
First, we must decide what our site will do, or
state its requirements. As a trivial site,
we are going do build something my.*.com style, which
holds a user's favorite links, a MyBookmarks site
if you will.
<p>
This site will require a user to login
with a chosen user name for security,
and view, add, and delete their internet bookmarks.
The deletion will leave the deleted bookmark data in the form to allow
easy modification and recreation of that bookmark.
<p>
The user will also be able to logout, and the system
will auto-logout their account automatically after
15 minutes, so that if it is a public terminal, another user using the
same browser later will not be able modify the
first user's bookmarks.
<p>
<h3>Specification</h3>
Often times, there is a specification round that we
must do to pick our web application environment and
hardware, as well as supported client software, but this is a no
brainer here. We are choosing Apache::ASP because of its built
in <tt>$Session</tt> which make user logins easy, and its built
in event <tt>Session_OnEnd</tt> which will automatically destroy
the contents of <tt>$Session</tt> every <tt>SessionTimeout</tt>, which
defaults to 20 minutes.
<p>
Also, because our web application has more than one page, we
will make use of the same headers and footers for each
page, using the includes <tt><!--#include file=src.inc--></tt>
functionality to modularize the html.
<h3>Design</h3>
Before we start coding, let's take a minute to diagram
what pages and actions our MyBookmarks web application
needs to have. We have 2 pages, the intro, and the
actual bookmarks page, where we get to view, add, and
delete the bookmark entries. We have the user login to
the bookmarks, and logout, securing access for the user's
eyes only.
<p>
<center><img src=flow.gif border=0></center>
<p>
You might also design the objects, methods, and functions
that will be used for the site, but this site is so
simple, that we are going to jump into implementation.
<h3>Implementation</h3>
We start by configuring <tt>.htaccess</tt> file
of a directory in apache to allow Apache::ASP
to run <tt>.asp</tt> files, and testing the configuration
with a <tt>dummy.asp</tt> file.
<p>
<center>
<table border=0 cellspacing=0 width=90% >
<tr bgcolor=gray><td><font color=white><b># .htaccess</b></td></tr>
<tr bgcolor=#c0c0c0><td><pre>
( run in 1.600 second using v1.01-cache-2.11-cpan-39bf76dae61 )