#this is a bit crude and unsophistacted as cgi scripts go, But you get
#the idea i'm sure
#!/usr/bin/python

import cgi,pg

def so_far(pgc):
    print """<tr><td><h2>So far</h2> <h3>Eugene Unix and Gnu/Linux Users 
Group</h3><h1>Demo Day!</h1></p>
    <h2>The following people have offered to conduct 
demonstrations</h2><br><br></tr></td>"""    
    query="""select distinct name,demo from demos;"""
    r = pgc.query(query).dictresult()
    for d in r:       
        print "<tr><td>%s</td><td>%s</td></tr>" % (d["name"],d["demo"])
    print """<tr><td align="center"><a href="http://www.euglug.org";>Back To 
Euglug</a></td></tr>"""
    
def main():
    print "Content-type: text/html"
    print
    print "<html><body>"
    print """<img src="../images/tux_logo.gif">"""
    print """<H1 align="center">EUGLUG Demoday signup</h1>"""
    print """<table width="100%" cellspacing="0" cellpadding="10">"""
    pgc = pg.DB(dbname='euglug',host='localhost')
    fld = cgi.FieldStorage()
    so_far(pgc)
    print "</table></body></html>"
    pgc.close()
    
main()

Larry Price      |  "We have seen the truth.
[EMAIL PROTECTED]  |   And the truth makes no sense." -chesterton
_______________________________________________________________

Reply via email to