Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/Python27/python
- import cgi,cgitb
- import datetime
- import sqlite3
- #Nama : Budi Darmawan
- #Kelas : 4A
- #NIM : 15090088
- # kirim.py
- #create intance of FieldStorage
- form = cgi.FieldStorage()
- conn=sqlite3.connect('C:\Users\SeHia\Documents\userpasswd.db')
- cur=conn.cursor()
- username = form.getvalue('username')
- password = form.getvalue('password')
- print "Content-type: text/html"
- print
- print "<html>"
- print "<head><title> Test form</title></head>"
- print "<body>"
- print "<form method='post' action='Kirim.py'>"
- cur.execute('SELECT * FROM userpasswd WHERE user = ? AND password=?',(username,password))
- if cur.fetchall() :
- print "selamat datang <b>"+username+"</b> anda login pada " + str(datetime.datetime.now())
- else:
- print "username atau password salah"
- print "</body>"
- print "</html>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement