Arc Forumnew | comments | leaders | submitlogin
2 points by Joseph_Bui 6166 days ago | link | parent

TCL in AOLserver

  if {[ns_conn method] eq "POST"} {
    ns_set put [ns_conn outputheaders] Set-Cookie "foo=[ns_urlencode [ns_set get [ns_getform] foo]]; Path=/"
    set page "<html><body>said.tcl</body></html>"
  } elseif {[regexp {foo=([^;]*)} [ns_set iget [ns_conn headers] cookie] match foo]} {
    set page "<html><body>you said: [ns_quotehtml [ns_urldecode $foo]]</body></html>"
  } else {
    set page "<html><body><form method='POST' action='said.tcl'><input name='foo'><input type='submit'></body></html>"
  }
  ns_return 200 text/html $page