Hi all,
It is a patch that can get a POST Parameter for function CGI:get.
it works this form.
<form action="/cgi-bin/post-data.cgi" method="POST" enctype="multipart/form-data">
<input type="checkbox" name="checkbox1" value="val1"/>val1<br/>
<input type="checkbox" name="checkbox1" value="val2"/>val2<br/>
<input type="checkbox" name="checkbox1" value="val3" checked/>val3<br/>
<input type="text" name="text1" size="30" maxlength="30" value="text sample">
<textarea name="textarea1" cols=40 rows=4>
abc
def
0123456789
</textarea>
<input type="submit" value="send"/>
(println CGI:params) ;; context parameter(for debug)
(println "checkbox1=" (CGI:get "checkbox1") "<br/>")
(println "text1=" (CGI:get "text1") "<br/>")
(println "textarea1=" (CGI:get "textarea1") "<br/>")
Result
params (("textarea1" "abcrndefrn0123456789rn") ("text1" "text sample") ("checkbox1" "val3") ("checkbox1" "val2"))
checkbox1=val3
text1=text sample
textarea1=abc def 0123456789
TEXTAREA returns multi-line string, line separator is "rn", see Result "textarea1".
thanks,
[attachment=0]new-cgi-module.zip[/attachment]
Thanks Unya for the "multipart/form-data" content-type addition, the new cgi.lsp is online here:
http://www.newlisp.org/code/modules/cgi.lsp.html