
.ig >>
<STYLE TYPE="text/css">
<!--
        A:link{text-decoration:none}
        A:visited{text-decoration:none}
        A:active{text-decoration:none}
        OL,UL,P,BODY,TD,TR,TH,FORM { font-family: arial,helvetica,sans-serif;; font-size:small; color: #333333; }

        H1 { font-size: x-large; font-family: arial,helvetica,sans-serif; }
        H2 { font-size: large; font-family: arial,helvetica,sans-serif; }
        H3 { font-size: medium; font-family: arial,helvetica,sans-serif; }
        H4 { font-size: small; font-family: arial,helvetica,sans-serif; }
-->
</STYLE>
<title>quisp: starting out</title>
<body bgcolor=99cc99 vlink=0000FF>
<br>
<br>
<center>
<table cellpadding=2 bgcolor=FFFFFF width=550 ><tr>
<td align=right><a href="handbook_home.html">
<img src="img/quisp2.gif" border=0><br><small>quick server pages</a> &nbsp; &nbsp; </td></tr>
<td>
.>>

.TH Starting out TDH "08-MAR-2004   TDH scg@jax.org" 

.SH Starting out
.ig >>
<br><br><br>
.>>

.LP
Start with a file with HTML in it, located in the \fC./pages\fR
subdirectory that is created when you 
.ig >>
<a href="quickstart.html">
.>>
\0set up your project.
.ig >>
</a>
.>>
The file can be named anything.. an \fC.html\fR suffix is not required nor recommended.
Also, the file does not need to contain an \fC<html>\fR tag.

.ig >>
<br><br><br>
.>>

.LP
Add QUISP directives.
QUISP directives begin with pound sign (#).  An example is \fC#if\fR.
A directive occupies one (and only one) line.

.ig >>
<br><br><br>
.>>

.LP
Any line where the first non-whitespace content is \fC//\fR is a comment and is ignored.

.ig >>
<br><br><br>
.>>

.LP
QUISP uses 
.ig >>
<a href="variables.html">
.>>
\0variables.
.ig >>
</a>
.>>
Variables can be set directly using the \fC#set\fR directive, or they may be set based on incoming CGI
user variables (embedded in the URL or submitted via a form POST) or cookies.
Variable names are written beginning with
an at-sign (@) when the contents are to be displayed or referenced.

.ig >>
<br><br><br>
.>>

.LP
Any line that is not a directive or a comment is output directly, with @variables evaluated.
Thus there is often no need for "print" statements.  Also, quoting hassles are minimized.

.ig >>
<br><br><br>
.>>
.SH Simple example 1
Here's a simple example... suppose it resides in a file called \fCtest1\fR...
.nf
\0 // a simple example..
\0 #cgivar xval
\0 <title>My first QUISP page</title>
\0 <body bgcolor=FFFFFF>
\0 <br>
\0 <h2>My first QUISP page</h2>
\0 #if @x = ""
\0    parameter xval was not supplied.
\0 #else
\0    you passed xval as @xval !
\0 #endif
\0 <br>
\0 <br>
\0 <a href="?rtn=test1&xval=8">Try it again with xval = 8</a>
.fi
Note the last line.. the page contains a link back to itself.
The special variable fBrtn\fR names the QUISP page to be loaded.

.ig >>
<br><br><br>
.>>

.LP
Now view your result by going to a URL like this:
\fC http://yourdomain.org/cgi-bin/quispcgi?rtn=view1&xval=5 \fR
.LP
(specifics will of course depend on your home system)

.ig >>
<br><br><br>
.>>

.LP
.SH Simple example 2
Now let's take the same example and add a fill-in field...
when the user clicks on [Go] the page will "call itself".
.nf
\0 // simple example II..
\0 #cgivar xval
\0 <title>My first QUISP page</title>
\0 <body bgcolor=FFFFFF>
\0 <br>
\0 <h2>My first QUISP page</h2>
\0 #if @x = ""
\0    parameter xval was not supplied.
\0 #else
\0    you passed xval as @xval !
\0 #endif
\0 <br>
\0 <br>
\0 <form action="@CGIPROG" method=GET>
\0 #formtarget test1
\0 Enter a value: <input name=xval value="@xval" size=6>
\0 <input type=submit value="Go">
\0 </form>

.ig >>
<br>
<br>
</td></tr>
<td align=right>
<a href="handbook_home.html">
<img src="img/quisp2.gif" border=0></a><br>
<small>quick server pages &nbsp; &nbsp;<br>
<a href="Copyright.html">Copyright Steve Grubb</a> &nbsp; &nbsp;
</td></tr>
</table>
.>>

