Chapter 4.1: CML State Functions |
[TOP] [UP] [NEXT] |
The CML state functions are the glue that ties a group of CML pages and a Sweb server together. To understand more about why they exist, see the design document "The Web Caucus". For the CML author, it is only necessary to understand where they must be used.
"<A HREF="http://$host()/dir/page.html">some text</A>
"<A HREF="http://$host()/sweb/swebsock/$pid()/SP/test.cml?15+bye">
" name</A>
The $form() function transparently handles both standard ("application/x-www-form-urlencoded") and "multipart/form-data" forms. $form() may be used only with METHOD=POST forms.
Multipart forms may be used with some browsers to upload an entire file, with an HTML tag of the form <INPUT TYPE="file" NAME="name">. In this case, $form(name) evaluates to the name of a temporary file on the server host. (The uploaded data has been placed in that file). The temporary file will be automatically deleted when the swebs process exits (i.e., when the user's session is over). The original name of the file is also available as $form(name.upload)