help: Problem with cgi form

Michal Wallace sabren at manifestation.com
Sat Feb 23 09:16:49 EST 2002


On 23 Feb 2002, Flavian Hardcastle wrote:

> I know when it's undeclared ... whenever a user first
> tries to access the form, it is undeclared. What I want to
> know is how to get the script to check whether this value
> has not been declared yet.

Um. Why don't you just declare it, and assign a default
value?

Failing that:

     locals().get("varname", "defaultvalue")

or:

     is_declared = locals().has_key("varname")

Cheers,

- Michal   http://www.sabren.net/   sabren at manifestation.com 
------------------------------------------------------------
Give your ideas the perfect home: http://www.cornerhost.com/
 cvs - weblogs - php - linux shell - perl/python/cgi - java
------------------------------------------------------------





More information about the Python-list mailing list