River's Edge Rest.& Party House Website is a community education project
[tues-crep.git] / sites / rochesterbanquets.com / httpdocs / rer-jan16 / test / fcgi / test.fcgi
blob905d73ba2efd2eb066b2620ea517941ecc607925
1 #!/usr/bin/python
3 import fcgi, os, sys, cgi
5 count=0
7 while fcgi.isFCGI():
8 req = fcgi.Accept()
9 count = count+1
11 req.out.write("Content-Type: text/html\n\n")
12 req.out.write("""<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
13 <html>
14 <head>
15 <title></title>
16 <link rel="stylesheet" type="text/css" href="../../css/style.css">
17 </head>
18 <body>
19 <table cellspacing="0" cellpadding="0" border="0">
20 <tr class="subhead" align="Left"><th>Name</th><th>Value</th></tr>""")
21 req.out.write('<tr class="normal"><td>%s</td><td>%s</td></tr>\n' % ("Request counter", count))
22 names = req.env.keys()
23 names.sort()
24 cl = ('alt','normal')
25 i= 0
26 for name in names:
27 if not name.find("HTTP") or not name.find("REQUEST"):
28 req.out.write('<tr class="%s"><td>%s</td><td>%s</td></tr>\n' % (cl[i%2],
29 name, cgi.escape(`req.env[name]`)))
30 i = i+1
32 req.out.write('</table>\n</body></html>\n')
34 req.Finish()