metanohi/site/projects/an5w/index.org

2.7 KiB

an5w

#&summary A PHP script for simple surveys #&

an5w

#&img;url=art.png,title=Hmm..

an5w (pronounced "answ" as in "answer") is a simple PHP program for creating online surveys. It consists of just two PHP files, one that serves the user and one that shows the answers.

Download

Documentation

You will not find any documentation in the an5w tarball — not even a single readme. When you've extracted the an5w directory from the tarball, put it in a place your webserver recognizes. That should work.

The code has no comments, basically because it's scaringly simple and extremely short. an5w is released under the WTFPL&acro='Do What The Fuck You Want To Public License', as published by Sam Hocevar here.

A raw an5w directory has the following files and directories (answers and art are directories):

#&pre answers button footer index.php style.css wrapper art done header questions title #&

However, only the ones in bold are actually necessary. You can remove the rest without an5w failing. In the 'answers' directory, it's the same:

#&pre index.php style.css #&

Again, only the bold ones are needed. In this case, you only need 'index.php'.

Description of files

#++pre

answers/index.php: 
  The program that shows answers

answers/style.css:
  CSS styles

button:
  The text of the submit button. Default is "Submit".

footer:
  Text to display on the bottom of the page. Default is nothing.

index.php:
  The main program

style.css:
  CSS styles

wrapper:
  The HTML element(s) that wrap everything else. Default is
  "<div id='wrapper'>TEXT</div>\n" (where TEXT is the actual content).

art/art.xcf:
  Promotional question marks

art/art-small.png:
  Promotional question marks in mini version

done:
  Text to display when the survey has been completed.

header:
  Text to display on the top of the survey page.

questions:
  The actual questions. See the *markup* section below.

title:
  The title of the survey. Will only be displayed on the titlebar of the page.

Markup

The syntax used in the 'questions' file is really quite simple. It looks like this:

#&pre Question Type of input (in form of text, multiple choices, etc.)

Another question Type of input #&

An example:

#&pre To what extent do you get annoyed when people attack you with pencils? []

Why are cows unable to fly (in your own opinion)? [] #&

Currently (as of version 0.001), only the '[]' input type is supported. '[]' = <textarea>.

A question can only take up one line. If you need a newline, use a <br /> tag instead.

To see answers, just visit answers/index.php in your web browser.

Details

an5w does not store data a database. It uses text files.