Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Newbie Rebol (CGI) questions

From: kpeters:mvinc at: 15-Apr-2004 22:07

Hi All ~ From the web tutorials I have doctored the script below together which leaves me with three questions: 1) Why do I receive an error if i omit the print line immediately after the REBOL [] header? 2) How can I insert LFs in the line " emit [ mold var mold value ]" to make the mail more readable? 3) How can i do the set-net stuff permanently? Thanks again for any help! Kai #! /usr/local/bin/rebol -cs REBOL [] print "Content-type: text/html^/" response: make string! 2000 emit: func [data] [repend response data] read-cgi: func [ /local data buffer ][ switch system/options/cgi/request-method [ "POST" [ data: make string! 1020 buffer: make string! 16380 while [positive? read-io system/ports/input buffer 16380][ append data buffer clear buffer ] ] "GET" [data: system/options/cgi/query-string] ] data ] foreach [var value] decode-cgi read-cgi [ emit [ mold var mold value ] ] set-net[ [kpeters--somedom--net] smtp.telus.net ] header: make system/standard/email [ To: [[kpeters--somedom--net]] From: [[kpeters--somedom--com]] Subject: "Message with a header" Organization: "Super Org" ] send/header [kpeters--somedom--net] response header