Get CGI Server Environment Variables


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #!/usr/bin/env python
  2.  
  3. import os
  4.  
  5. print 'Content-Type: text\html
  6.  
  7. '
  8. print '<h1>Server CGI Environment</h1></br>'
  9. print '<ul>'
  10. for param in os.environ.keys():
  11. print '<li>%s = %s</li>' % (param,os.environ[param])
  12. print '</ul>'

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.