#!/usr/bin/env python3
#=====================================================================================
# List all environment variables 
#=====================================================================================
import os                                       #import os module 

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

try:
    method = os.environ["REQUEST_METHOD"] or ""
except:
    method = ""

print("GET or POST?" ,method, "<br>")

print("<h2>List of Environment Variables</h2>")
print("<table border=1>")

for key in sorted(os.environ.keys()) :
	print("<tr><td><b>", key, "<td>", os.environ[key] )
    
print("</table>")




#=== 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
#=================================================================================