# get some enviromental values
form = cgi.FieldStorage()
mail = form.getvalue('mail') or ''
comment = form.getvalue('comment') or ''

        # insert guest comments into database if form was submitted
        if '@' in mail and comment not in ("Ρωτήστε με σχετικά..."):
                try:
                        cursor.execute( '''INSERT INTO users(mail, comment) 
VALUES(%s,
%s)''', (mail, comment) )
                except MySQLdb.Error, e:
                        print ( "Error %d: %s" % (e.args[0], e.args[1]) )

                print ( "<h2><font color=blue>Ευχαριστώ για την ερώτηση! Θα σας
απαντήσω το συντομότερο δυνατό!" )
                sys.exit(0)
        else:
                print ( "<h2><font color=red>Συμπλήρωσε σωστά το mail σου και 
δώσε
το σχολιασμό σου!" )
                sys.exit(0)
==============================================

In my webpage here http://superhost.gr/hosting.html i ask the users
mail and comment in a html form.

No matter what info the user gives after he submits the form, nothing
else happens instead of reloading the page itself while what i want
the code to do is to enter the if structure and display the
appropriate message, depending if the user entered data in the imput
box or not.

Am i missing something here?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to