# load up the CGI library
import cgi
# print HTTP/HTML headers
print """Content-type: text/html
Integer Add Script
"""
# give me the form data
form = cgi.FieldStorage()
# default values
left = ''
right = ''
total = '?'
error = ''
# is there form data?
if 'left' in form and 'right' in form:
left = form['left'].value
right = form['right'].value
# make sure these are numbers
if left.isdigit() and right.isdigit():
# all is OK, add the numbers up!
total = str(int(left) + int(right))
else:
error = 'ERROR: non-integer used as input!'
# printing the form
print ''