Ns queryexists

From AOLserver Wiki
Revision as of 16:35, 11 June 2004 by WikiSysop (talk | contribs) (imported from WiKit id 621)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Man page: http://aolserver.com/docs/tcl/ns_queryexists.html


NAME

ns_queryexists - Check for a key in the query data that was part of the HTTP request

SYNOPSIS

ns_queryexists key

DESCRIPTION

This command looks in the query data for the specified key. If the key exists, 1 is returned; otherwise 0 is returned. The key is interpreted in a case-insensitive manner.

EXAMPLES

   ns_register_proc POST /queryexiststest queryexiststest
   proc queryexiststest { } {
       if {ns_queryexists name} {
           # ...process the form...
       } else {
           ns_returnerror 400 "you need to supply your name in the form"
       }
   } ;# queryexiststest

NOTES

Note that despite it's name, ns_queryexists works on POST form data as well as query string data.

SEE ALSO

ns_queryget, ns_querygetall

Category Documentation - Category Core Tcl API