Jump to content

Password generator

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
taabistan

taabistan

    Newbie

  • Members
  • Pip
  • 7 posts
Here is a link to a password generator I made. The password is junaidnoori but it always says it's "incorrect"

Passowrd

Can anyone help me?

here's the code:

i
mport cgi, cgitb

cgitb.enable()


form = cgi.FieldStorage()

passwd = form.getvalue("passwd")


print """Content-type: text/html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<title>Password</title>

</head>

<body>

"""


print "<h1>Password: Confidential</h1>"

print

passwd = form.getvalue("passwd")

if passwd=="junaidnoori":

    print "<p>Password is correct."

    print "Welcome to the secret web-site.</p>"

else:

    print "<p>Sorry, incorrect password.</p>"

    print "</body></html>" 



#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
Within your online script you set the input name of the password field to " name="name" ", are you sure it doesn't have to be " name="passwd" " ?
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
taabistan

taabistan

    Newbie

  • Members
  • Pip
  • 7 posts
Oh, thanks! I see that now.

#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
You're welcome. :)
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.