title: Using Python Web GET data
body: <p>I'm trying to pass information to a python page via the url. I have the following link text:</p>
  
  <pre><code>"&lt;a href='complete?id=%s'&gt;" % (str(r[0]))
  </code></pre>
  
  <p>on the complete page, I have this:</p>
  
  <pre><code>import cgi
  def complete():
      form = cgi.FieldStorage()
      db = MySQLdb.connect(user="", passwd="", db="todo")
      c = db.cursor()
      c.execute("delete from tasks where id =" + str(form["id"]))
      return "&lt;html&gt;&lt;center&gt;Task completed! Click &lt;a href='/chris'&gt;here&lt;/a&gt; to go back!&lt;/center&gt;&lt;/html&gt;"
  </code></pre>
  
  <p>The problem is that when i go to the complete page, i get a key error on "id". Does anyone know how to fix this?</p>
  
  <p><em>EDIT</em><br>
  when i run <code>cgi.test()</code> it gives me nothing</p>
  
  <p>I think something is wrong with the way i'm using the url because its not getting passed through.</p>
  
  <p>its basically <em>localhost/chris/complete?id=1</em></p>
  
  <p><em>/chris/</em> is a folder and complete is a function within <em>index.py</em></p>
  
  <p>Am i formatting the url the wrong way?</p>