NEWBIE-QUESTION concerning forms and saving input
I want to provide the visitor on my website a form like that: email: __________ | sendbutton to subscribe to a newsletter (exactly: to fetch the email address from the visitor and to write it into a single file) the newsletter will be manually generated. How can i do that exactly? Do i need a dtml-method for fetching the email address? How do i append the address to a file in the same zope-directory? -- thx in advance, Stefan Antoni ---------------------------- Mit Jan 9 18:39:19 EST 2002
cruciatuz writes:
I want to provide the visitor on my website a form like that:
email: __________ | sendbutton
to subscribe to a newsletter (exactly: to fetch the email address from the visitor and to write it into a single file)
the newsletter will be manually generated.
How can i do that exactly? Do i need a dtml-method for fetching the email address? You need an action, your form is send to. This may be a DTML object or a Python Script or an External Method.
How do i append the address to a file in the same zope-directory? What do you mean with "Zope directory"?
When you mean a file system directory (i.e. not in the ZODB), then an External Method would be best as action, because DTML objects and Python Scripts are unable to write to file system files. It is not so easy to append something to a "File" object in the ZODB, because they are not made to be easily appended. You need to use the "manage_upload" to set the file content with the new appended email. In the ZODB, it would be easier, to keep the Email addresses in a property (e.g. "lines" property) and use "manage_changeProperties" to set the property after the Email is appended. Dieter
On Thu, Jan 10, 2002 at 09:55:15PM +0100, Dieter Maurer wrote:
You need an action, your form is send to. This may be a DTML object or a Python Script or an External Method.
How do i append the address to a file in the same zope-directory? What do you mean with "Zope directory"? I mean a folder object (in the ZODB). If it is easier, i would also be satisfied with some plain text files like:
emailaddr001 emailaddr002 emailaddr003 emailaddr004 ... for each subscription.
... easier, to keep the Email addresses in a property (e.g. "lines" property) and use "manage_changeProperties" to set the property after the Email is appended.
i'm confused (property, manage_changeProperties(?)). i bought a book about zope yesterday, i think i'll read about dtml and forms before i post here again :) -- Stefan Antoni ---------------------------- Don Jan 10 22:46:52 EST 2002
participants (2)
-
cruciatuz -
Dieter Maurer