forked from electrodog10/clhsrecords
-
Notifications
You must be signed in to change notification settings - Fork 0
/
handler.py
32 lines (27 loc) · 873 Bytes
/
handler.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
import cgi
#import os
#import loadXML
#import display
#from xml.etree import ElementTree
form = cgi.FieldStorage() # instantiate only once!
#import file
#file_name = 'testrecords.xml'
#full_name = os.path.abspath(os.path.join('xml', file_name))
# get variables from html
htmlNumber = 1
name = form.getfirst('name', 'empty')
name = cgi.escape(name)
# initialize variables
#search = ['name','activity','year','record']
#searchnumber = ['1','2','3','4']
#searchXML = loadXML.searchingall(full_name) #finds all xml entries
#(name, activity, record, num, year) = display.display(searchXML,htmlName,int(htmlNumber),search)
#all vars coming out of the line above are arrays
#pineapple = (name[0], activity[0], record[0], num[0], year[0])
print("""\
Content-Type: text/html\n
<html>
<p class="page-description">The submitted name was "%s"</p>
</body>
</html>
""" % name)