Unsupported scripts and control panel web app for a hosting company
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

info.py 774B

12345678910111213141516171819202122232425262728
  1. #!/opt/python/current/bin/python
  2. import os
  3. import cgi
  4. print "Content-type: text/html"
  5. print
  6. print """<!DOCTYPE html PUBLIC
  7. "-//W3C//DTD XHTML 1.0 Transitional//EN"
  8. "DTD/xhtml1-transitional.dtd">"""
  9. print """
  10. <html xmlns = "http://www.w3.org/1999/xhtml" xml:lang="en"
  11. lang="en">
  12. <head><title>Environment Variables</title></head>
  13. <body><table style = "border: 0">"""
  14. rowNumber = 0
  15. for item in os.environ.keys():
  16. rowNumber += 1
  17. if rowNumber % 2 == 0:
  18. backgroundColor = "white"
  19. else:
  20. backgroundColor = "lightgrey"
  21. print """<tr style = "background-color: %s">
  22. <td>%s</td><td>%s</td></tr>""" \
  23. % ( backgroundColor, item,
  24. cgi.escape( os.environ[ item ] ) )
  25. print """</table></body></html>"""