diff options
author | chai <chaifix@163.com> | 2018-07-13 21:53:49 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-07-13 21:53:49 +0800 |
commit | 7ca80e57f06922e464626c7a6a1d7965e716b53f (patch) | |
tree | bda9271234720424b7dfc5c2d25b9df4ba3d01df /cgi-bin/delete.py | |
parent | 181b206863d3765fe5343ceea8e1e00e52ffba9e (diff) |
Diffstat (limited to 'cgi-bin/delete.py')
-rw-r--r-- | cgi-bin/delete.py | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/cgi-bin/delete.py b/cgi-bin/delete.py deleted file mode 100644 index 7c728a4..0000000 --- a/cgi-bin/delete.py +++ /dev/null @@ -1,36 +0,0 @@ -#!D:/Programs/Python3/python.exe -# -*- coding: utf-8 -*- -import cgi, cgitb -import pymysql -import sys, codecs -import configparser, codecs -import connect -from connect import Connect -import config -from config import Config -import path -from path import Path - -sys.stdout = codecs.getwriter('utf8')(sys.stdout.buffer) -print("Content-type:text/html\n") -form = cgi.FieldStorage() -w = form.getvalue('w') -if w == None: - print("Invalid whisper") -else: - db = Connect.produce() - cursor = db.cursor() - query = "delete from whisper where id={0}".format(int(w)) - cursor.execute(query) - db.commit() - cursor.close() - db.close() - _url = Config.get("route", "url") - redirect = """ - <html> - <head> - <meta http-equiv="refresh" content="0;url={0}/page.py"> - </head> - </html> - """.format(_url) - print(redirect)
\ No newline at end of file |