blob: a399124234ca6f13227fe317c10f9dc5c6b060b1 [file] [log] [blame]
mbligh94f07a22008-05-21 17:10:57 +00001#!/usr/bin/python
2
3import sys, os
4import MySQLdb
5import urllib, db, unique_cookie
6
7def body():
8 db_obj = db.db()
9 uid = unique_cookie.unique_id('tko_history')
10 condition = "uid='%s'" % uid
11 where = (condition,[])
12 try:
13 rows = db_obj.select("time_created,user_comment,url",
14 "query_history", where)
15 except MySQLdb.ProgrammingError, err:
16 print err
17 rows = ()
18
19 for row in rows:
20 (time_created, user_comment, tko_url) = row
21 print "<hr>"
22 print time_created + "&nbsp;"*3
23 print user_comment + "<br>"
24 print '<a href="%s">%s</a>' % (tko_url, tko_url)
25
26
27def main():
28 print "Content-type: text/html\n"
29 print
30 # create the actual page
31 print '<html><head><title>'
32 print 'History of TKO usage'
33 print '</title></head><body>'
34 body()
35 print '</body></html>'
36
37
38main()
39
40