forked from shrayanshjain9/Python-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.py
More file actions
32 lines (22 loc) · 625 Bytes
/
code.py
File metadata and controls
32 lines (22 loc) · 625 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!C:\Python27\python.exe
print "Content-Type:text/html\n\n"
import cgi
import MySQLdb
data=cgi.FieldStorage()
name=data.getvalue('name')
#print name
fname=data.getvalue('fname')
gender=data.getvalue('a')
email=data.getvalue('email')
password=data.getvalue('password')
con=MySQLdb.connect("127.0.0.1","root","","project",3306)
query="insert into ipec(name,fname,gender,email,password) values ('"+name+"','"+fname+"','"+gender+"','"+email+"','"+password+"')"
cur=con.cursor()
cur.execute(query)
con.commit()
con.close()
print """
<script>
window.location.href='login.py'
</script>
"""