quick server pages
   
Manual page for Starting(out)

Starting out




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.


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. Variable names are written beginning with an at-sign (@) when the contents are to be displayed or referenced.


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 fBrtn 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".
  // 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,    March 08, 2004.