Is there any better way to identif a previous visitor? i tried cookies which failed for me for the reason i opened this thread and host like follows:

                # try to locate the visitor
cur.execute('''SELECT * FROM visitors WHERE counterID = %s and host = %s''', (cID, host) )
                data = cur.fetchone()
                
                if not data:
                        # if first time visitor on this page, create new record
cur.execute('''INSERT INTO visitors (counterID, host, city, useros, browser, ref, lastvisit) VALUES (%s, %s, %s, %s, %s, %s, %s)''',
                                                   (cID, host, city, useros, 
browser, ref, lastvisit) )
                else:
                        # since visitor exists just update his record
cur.execute('''UPDATE visitors SET city = %s, useros = %s, browser = %s, ref = %s, hits = hits + 1, lastvisit = %s''', (city, useros, browser, ref, lastvisit) )
=======

Please tell me if you can think fo something else.

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to