#!/usr/bin/python3
"""
runs on the server, prints HTML to create a new page;
url=http://localhost/cgi-bin/server.cgi
"""

import os, cgi, sys
debugmode = False					# to help debug the script

sys.stderr = sys.stdout				# show error messages
form = cgi.FieldStorage()			# parse form data
print('Content-type: text/html\n')	# with blank line
if debugmode: cgi.print_form(form)	# print form fields in debug mode

# html templates

header = '''	
<html>
	<head>
		<title>Buy Your Way to a Better Health!</title>
		<link rel="stylesheet" href="insurance.css" />
	</head>

	<body>
		<h1>Thanks!</h1>

		<p>Your information has been recorded.</p>

		<dl>
'''

trailer = '''
</dl>
	</body>
</html>  
'''
def main():

# print html header
	print(header)

# print values passed to the server by the form

	print('''
	<dt>Name</dt>
			<dd> 
	%s </dd>''' % "???")

	print('''
	<dt>City</dt>
			<dd> 
	%s </dd>''' % "???")

	print('''
	<dt>Credit Card</dt>
			<dd> 
	%s </dd>''' % "???")

# print html trailer
	print(trailer)

main()	   	

