REBOL [
    title: "WAP File Viewer CGI"
    date: 10-Aug-2010
    file: %wap-file-viewer.r
    author:  Nick Antonaccio
    purpose: {
        Read text files on your web server using your WAP cell phone browser.
    }
]

#! ./rebol276 -cs
REBOL [title: "CGI WAP File Viewer"]
submitted: decode-cgi system/options/cgi/query-string
prin {Content-type: text/vnd.wap.wml^/^/}
prin {^/}
prin {^/}
if submitted/2 = none [   
    print {

} ; print {Name: } folders: copy [] foreach folder read %./Teachers/ [ if find to-string folder {/} [append folders to-string folder] ] print {Teacher: Submit } print {

} quit ] count: 0 parse read join http://site.com/folder/ submitted/2 [ thru submitted/2 copy p to "past students" ] print {} forskip p 130 [ count: count + 1 print rejoin [ {

} ] print rejoin [ {Next} ] print rejoin [{Back}] print copy/part p 130 print {

} ] print {
} quit