[Tutor] CGI problem.
kent_johnson at skillsoft.com
Mon Nov 8 16:34:46 CET 2004
At 05:32 PM 11/8/2004 +0200, Mark Kels wrote:
>I doesn't work :( ...
>Here is what I did :
>import cgitb; cgitb.enable()
>form = cgi.FieldStorage()
>print "Content-type: text/html\n\n"
> print """
> <form><input name="pass" type="text"></form>
> filepass=x.readline() # The password in the file is already digested.
> if repr(userpass)==filepass:
> print "OK, come in."
> print "Wrong password, try again!"
>the result is the same (out put is always for wrong password...).
I think you need to strip the newline from filepass:
If this doesn't work put in
so you can see what it is comparing
More information about the Tutor