From 4aa685b096ee617a8f980369d2ad942d00fe24ff Mon Sep 17 00:00:00 2001 From: clyhtsuriva Date: Sat, 16 May 2020 09:28:41 +0200 Subject: Update --- www/html/destination.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'www/html/destination.py') diff --git a/www/html/destination.py b/www/html/destination.py index e0729b1..062ab2f 100755 --- a/www/html/destination.py +++ b/www/html/destination.py @@ -26,14 +26,14 @@ def index(req): conn=connexionBD() cur=conn.cursor() - sql="select * from paquet where ip_destination='{}' ORDER BY heure DESC;".format(ip) - sql_count="select count(*) from paquet where ip_destination='{}';".format(ip) + sql="SELECT * FROM paquet WHERE ip_destination=%s ORDER BY heure DESC" + sql_count="SELECT COUNT(*) FROM paquet WHERE ip_destination=%s" - cur.execute(sql) + cur.execute(sql, (ip, )) conn.commit() data=cur.fetchall() - cur.execute(sql_count) + cur.execute(sql_count, (ip, )) conn.commit() count=cur.fetchone() @@ -55,10 +55,12 @@ def index(req): req.write(baseHTML(ip,"""

IP Destination : """ + ip + """

Nombre de paquets en destination de """+ ip + """ : """+ str(count[0])+ """

+
""" + content + """
HeureProtocoleIP SourceIP DestinationPort SourcePort Destination
+
""")) -- cgit v1.2.3