NaviServer - programmable web server

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

# ns_queryexists(n) 4.99.8 naviserver "NaviServer Built-in Commands"

## Name

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

## Table Of Contents

## 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.

## COMMANDS

ns_queryexists key

## EXAMPLES

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