form test

This commit is contained in:
Enno Rehling 2002-01-02 16:04:23 +00:00
parent bdeeee61bb
commit cadccb9804

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
import sys
import MySQLdb
@ -21,6 +21,9 @@ def Display(Content, Title=DefaultTitle):
TemplateInput = TemplateHandle.read()
TemplateHandle.close() # close the file
for field in Form.keys():
Content=Content+"<br>"+key+"="+Form[key]
# this defines an exception string in case our
# template file is messed up
BadTemplateException = "There was a problem with the HTML template."
@ -66,10 +69,10 @@ def ShowInfo(custid, Password):
output=output+"</table></div>"
query = ("select games.name, races.name, subscriptions.status, subscriptions.faction "+
"from races, games, subscriptions "+
"where subscriptions.race=races.race and subscriptions.game=games.id "+
"and subscriptions.user="+str(custid)+" ");
query = ("select games.name, races.name, s.status, s.faction "+
"from races, games, subscriptions s "+
"where s.race=races.race and s.game=games.id "+
"and s.user="+str(custid)+" ");
results = cursor.execute(query);
@ -104,7 +107,7 @@ def ShowInfo(custid, Password):
output=output+line
output=output+"</table></div>"
# output=output+"<div align=left><input type=submit value=\"Speichern\"></div>"
output=output+"<div align=left><input type=submit value=\"Speichern\"></div>"
output=output+"</form>"
else:
output = "Die Kundennummer oder das angegebene Passwort sind nicht korrekt."
@ -130,10 +133,14 @@ def SendPass(custid):
Form = cgi.FieldStorage()
if Form.has_key("user"):
custid = int(Form["user"].value)
if Form.has_key("user"):
custid = int(Form["user"].value)
else:
custid = 0
if Form.has_key("pass"):
Password = Form["pass"].value
else: