in line...<br><br>
<div class="gmail_quote">On Wed, Sep 23, 2009 at 9:13 PM, BJ Swope <span dir="ltr"><<a href="mailto:bigblueswope@gmail.com">bigblueswope@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">What is your code not doing?<br></blockquote>
<div> </div>
<div>see below</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Are you winding up with duplicate data in the DB?<br></blockquote>
<div> </div>
<div>yes</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Is your web browser re-submitting the form with the same data if you refresh the screen?<br></blockquote>

<div> </div>
<div>yes</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Is your web browser pre-filling the fields of the form due to caching?<br></blockquote>
<div> </div>
<div>no</div>
<div> </div>
<div>If I must use cookies, do I want cookielib/cookiejar, or just Cookie?</div>
<div>TIA.</div>
<div>V</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>I don't understand what's not working 
<div>
<div></div>
<div class="h5"><br><br>
<div class="gmail_quote">On Wed, Sep 23, 2009 at 12:40 PM, Victor Subervi <span dir="ltr"><<a href="mailto:victorsubervi@gmail.com" target="_blank">victorsubervi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">I've been trying the hidden field, but the problem is that when I set the variable flag, it stays in memory. I would rather just pass a var like I've been trying, but I don't think it's possible. Any ideas? Is a session cookie the only way? Here's more simplified code: 
<div><br><br>#!/usr/bin/python<br><br>import cgitb; cgitb.enable()<br>import cgi<br>import sys,os<br>sys.path.append(os.getcwd())<br>import MySQLdb<br></div>import string, re<br><br>def client():<br>  form = cgi.FieldStorage()<br>
  client = string.replace(string.replace(form.getfirst('client', ''), "'", '&#39;'), '"', '&#34;')<br>  flag = form.getfirst('flag', '') 
<div><br>  print "Content-Type: text/html"<br>  print<br>  print """<br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd</a>"><br>
<head xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>"><br></div><body><br>"""<br>  if flag == '':<br>    print """<br>
<form method="post" action="client.py"><br>Company Name: <input type='text' value='' size='20' maxlength='100' name='client' /><br /><br><input type='hidden' name='flag' value='y' /> 
<div><br><div align='center'><br>  <input type='submit' value=' Send ' /><br></div><br></form><br></body></html><br>"""<br></div>  else:<br>    host = 'h'<br>
    db = 'db'<br>    user = 'u'<br>    passwd = '1' 
<div><br>    database = MySQLdb.connect(host, user, passwd, db)<br>    cursor = database.cursor()<br></div>    cursor.execute('insert into companies (client);' % (client))<br>    cursor.close()<br>    print '</body></html>'<br>
<br>client()<br><br>TIA,<br><font color="#888888">V</font> 
<div>
<div></div>
<div><br>
<div class="gmail_quote"><br>On Tue, Sep 22, 2009 at 1:43 PM, Dennis Lee Bieber <span dir="ltr"><<a href="mailto:wlfraed@ix.netcom.com" target="_blank">wlfraed@ix.netcom.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">On Tue, 22 Sep 2009 12:50:31 -0400, Victor Subervi<br><<a href="mailto:victorsubervi@gmail.com" target="_blank">victorsubervi@gmail.com</a>> declaimed the following in<br>
gmane.comp.python.general:<br>
<div><br>> Well it's Web stuff, sure, but it's written in python :) The code follows.<br>> The problem is that I haven't figured out how to tell the program that the<br>> user has entered data and to clear the cache of that data so that it's not<br>
> re-entered. How do I do that?<br><br></div>       Remember, HTTP is a stateless protocol. EACH submission is<br>considered a totally new transaction with no memory of the previous<br>processing.<br><br>       Possible solutions...<br>
<br>*       Use a session cookie that identifies what phase in the multistep<br>processing you are in...<br><br>*       Use a hidden field in the form that defaults to, say "False", when<br>you first display the form, but then gets set to "True" during the first<br>
response process (and is then sent back out with "True" so the second<br>response takes a different branch).<br><br>--<br>       Wulfraed         Dennis Lee Bieber               KD6MOG<br>       <a href="mailto:wlfraed@ix.netcom.com" target="_blank">wlfraed@ix.netcom.com</a>   <a href="http://wlfraed.home.netcom.com/" target="_blank">HTTP://wlfraed.home.netcom.com/</a><br>
<font color="#888888"><br>--<br></font>
<div>
<div></div>
<div><a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br></div></div></blockquote></div><br></div></div><br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
<br></blockquote></div><br><br clear="all"><br></div></div>
<div>
<div></div>
<div class="h5">-- <br>To argue that honorable conduct is only required against an honorable enemy degrades the Americans who must carry out the orders. -- Charles Krulak, Former Commandant of the Marine Corps<br><br>We are all slave to our own paradigm. -- Joshua Williams<br>
<br>If the letters PhD appear after a person's name, that person will remain outdoors even after it's started raining. -- Jeff Kay<br><br></div></div><br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
<br></blockquote></div><br>