#!/usr/bin/env python3
#=====================================================================================
# Receive the form input field 
#=====================================================================================
#import cgi                                      #import cgi 
import HTTPparam

print("Content-Type: text/html \n")             #required HTTP header

print('''                                                
    <html>
    <head>
    <title>An HTML form Processor</title>
    </head>
    <body>
    <h2>This form is processed by Python</h2>
    <br><br>
''')                                                     

#formData = cgi.FieldStorage()                   #access the form data                           
#name     = formData.getvalue('fullname')        #get the value of the field "fullname"
name = HTTPparam.getValue('fullname') 

print("You have entered", name)

print('''
    </body>
    </html>
''')




#=== link to see the python code =================================================
import os, sys
sys.path.insert(0,'/home/staff/sultan/public_html/cgi-bin/python')
import zCode                          #import func to display the Python code
filename = os.path.abspath(__file__)  #get absolute file name 
zCode.display(filename)               #call it
#=================================================================================