# Collection of code snippets by Arne Vajhøj 
# (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
import os
import pymysql

f1 = os.getenv('FORM_FLD_F1')
f2 = os.getenv('FORM_FLD_F2')
con = pymysql.connect(host='localhost',user='root',password='',db='test')
c = con.cursor()
c.execute('INSERT INTO t1(f1,f2) VALUES(%s,%s)', (f1,f2))
c.close()
con.commit()
con.close()
print('Location: http://arne1.vajhoej.dk:81/htbin/showpy')
print('')
