help: Problem with cgi form

mylinuxboxroot aries at bitstream.net
Sat Feb 23 04:33:15 EST 2002


Flavian Hardcastle <deathtospam43423 at altavista.com> wrote in message
news:Xns91BEB7AC37F78AusYourStandingInIt at 130.133.1.4...
> Gustavo Cordova <gcordova at hebmex.com> wrote in
> news:mailman.1014420097.13372.python-list at python.org:
>
> >>
> >> I'm a beginner. How do I do this? It's probly very simple ......
> >>
> >> I have a hidden input on a cgi form...
> >>
> >>     print '<INPUT TYPE=HIDDEN NAME= "last_pos"
> >> VALUE=',last_byte_pos,'>'
> >>
> >> I need the VALUE to be the  variable "last_byte_pos", but
> >> unfortunately when I run the script for the first time the script
> >> crashes because it's
> >> undeclared.
> >>
> >> What subroutine do I use to check if last_byte_pos is undeclared, and
> >> assign it a default value if it is?
> >>
> >
> > How can you not know if "last_byte_pos" is undeclared?
> > Have you assigned any values to it previously?
> > no?
> >
> > then it's undeclared.
> >
> > -gus
> 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.
>
>
> --
> "You can tell whether a man is clever by his answers. You can tell whether
> a man is wise by his questions."  Naguib Mahfouz
>
> netvegetable at dingoblue.net.au

if value not in last_byte_pos:
    last_byte_pos = value
    print "this is no not know if value is undeclared funny business??"
elif:
    last_byte_pos = value = last_byte_pos = last_byte_pos = value
    print "this is no know if value is declared funny business"
else:
    print "maybe its a design flaw"






More information about the Python-list mailing list