![]() |
Use cookie in form
Hi there.
I'm working on a Python program where I load a form with text fields and then save input as a cookie. I print my HTML code by doing: :
print content-type: text/htmlI have two questions. One is that my cookies are not replaced by the newest search words. I just have the first cookie from the first search I did with my script. Second question and hurtle is, that I want my value="" in my form to have the last word I've entered in my text field, that is my cookie for "mycookie". I can post the whole code if it's easier for you to see my problem and/or explain what I'm doing wrong. Greetings Public2 |
Have found a solution...
|
Quote:
|
The solution was:
Question 1: To make a cookie from my input forms, I had to set it up like this: :
cookie = Cookie.SimpleCookie()Then i use my cookies as arguments when I call my HTMLbody function: :
HTMLbody(cookie['form1'].value,cookie['form2'].value,cookie['form3'].value)I my HTML body, I write my HTML out, and use my cookies with the %-function, like this: :
<div>:
<div> |
| All times are GMT -5. The time now is 12:44 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC