quisp: basics

quick server pages
| Manual page for Basics(TDH)

## Basics

Start with a file with HTML in it, located in the `./pages` subdirectory that is created when you set up your project.`` The file can be named anything.. an `.html` suffix is not required nor recommended.`` Also, the file does not need to contain an `<html>` tag.``

Add QUISP directives.`` QUISP directives begin with pound sign (#). An example is `#if`.`` A directive occupies one (and only one) line.`` The various directives are listed on the front page and on the quick reference syntax summary.``

Any line where the first non-whitespace content is `//` is a comment and is ignored.``

QUISP uses variables.`` Variables can be set directly using the `#set` directive, or they may be set based on incoming CGI user variables (embedded in the URL or submitted via a form POST) or cookies.`` User variable names must begin with an alphabetic character and can contain alphanumerics and underscores. Variables originating from an sql join result will contain an embedded period.`` Variables are written with a leading at-sign (@) when the contents are to be displayed or referenced.`` Variables are delimited on whitespace and punctuation characters except underscore and period.`` Thus, something like `@a.@b` will not work because the period is taken to be part of the variable name.``

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.``

## Simple example 1

Here's a simple example... suppose it resides in a file called `test1`...``

      // a simple example..
      #cgivar xval
      <title>My first QUISP page</title>
      <body bgcolor=FFFFFF>
      <br>
      <h2>My first QUISP page</h2>
      #if @x = ""
         parameter xval was not supplied.
      #else
         you passed xval as @xval !
      #endif
      <br>
      <br>
      <a href="?rtn=test1&xval=8">Try it again with xval = 8</a>

Note the last line.. the page contains a link back to itself.`` The special variable rtn names the QUISP page to be loaded.``

Now view your result by going to a URL like this: `http://yourdomain.org/cgi-bin/quispcgi?rtn=view1&xval=5`

(specifics will of course depend on your home system)

## 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", sending the entered value for `xval`.``

      // simple example II..
      #cgivar xval
      <title>My first QUISP page</title>
      <body bgcolor=FFFFFF>
      <br>
      <h2>My first QUISP page</h2>
      #if @x = ""
         parameter xval was not supplied.
      #else
         you passed xval as @xval !
      #endif
      <br>
      <br>
      <form action="@CGIPROG" method=GET>
      #formtarget test1
      Enter a value: <input name=xval value="@xval" size=6>
      <input type=submit value="Go">
      </form>

quick server pages
Copyright Steve Grubb

Markup created by unroff 1.0, `` `` April 13, 2004.