REBOL [
    title: "WAP File Editor CGI"
    date: 10-Aug-2010
    file: %wap-file-editor.r
    author:  Nick Antonaccio
    purpose: {
        Edit text file (insert only) using your WAP cell phone browser.
    }
]

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

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

} quit ] chosen-file: rejoin [%./Teachers/ submitted/2 "/schedule.txt"] adjusted-file: read/lines chosen-file insert next next next next adjusted-file submitted/4 write/lines chosen-file adjusted-file count: 0 parse read join http://site.com/folders/ 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