-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.py
39 lines (39 loc) · 925 Bytes
/
contact.py
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
33
34
35
36
37
38
39
#!C:\Users\user\AppData\Local\Programs\Python\Python38\python.exe
print("Content-type:text/html\r\n\r\n")
import mysql.connector
import cgi
db=mysql.connector.connect(host="localhost",user="root",passwd="",db="ardent_pr")
cur=db.cursor()
cur.execute("select * from msg")
x=cur.fetchall()
db.commit()
print("""
<html>
<head>
<title>view</title>
<link rel="stylesheet" type="text/css" href="css/table1.css">
</head>
<body>
<h1><u>STUDENT QUERY</u></h1>
<table class="content-table" >
<thead>
<th>name</th>
<th>email</th>
<th>message</th>
</thead>
<tbody>
""")
for i in range(len(x)):
print("""
<tr class="active-row">
<td>{0}</td>
<td>{1}</td>
<td>{2}</td>
</tr>
</tbody>
""".format(x[i][0],x[i][1],x[i][2]))
print("""
</table>
</body>
</html>
""")