<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Form variables are stored in REQUEST. In a python
script you gain access to REQUEST by:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>REQUEST = container.REQUEST<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>you can then access the form variables
by:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>fname = REQUEST['first_name']</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>you can check for the presence of a form variable
by</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2>if
REQUEST.has_key('first_name'):</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2>or</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2>if REQUEST.get('first_name',
None):</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2>hth</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2>Jonathan</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2></FONT> </DIV></FONT>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=myan@umich.edu href="mailto:myan@umich.edu">Muk Yan</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=zope@zope.org
href="mailto:zope@zope.org">zope@zope.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, August 17, 2006 2:57
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Zope] Python Scripts and HTML
Forms</DIV>
<DIV><BR></DIV>Dear Trusted Zope Zealots,<BR><BR>This subject was a bit too
broad to do a google search on, because I've tried and the lack of relevancy
was astounding.<BR><BR>I've probably been committing a cardinal sin in DTML,
but I couldn't figure any other work around. <BR><BR>I have an HTML form in a
DTML Document say:<BR><BR><form action="process_this_form"
method="post"<BR><BR>Name:<input type="text"
name:"first_name"><BR><BR></form> <BR><BR>I want to use "first_name"
in a python script, but what I've been doing is setting it in the
process_this_form, which is a DTML method:<BR><BR>DTML Method,
process_this_form:<BR><dtml-call "REQUEST.SESSION.set ('firstName',
first_name)><BR><dtml-call "this_is_a_python_script()"><BR><BR>and in
the Python Script, this_is_a_python_script<BR>I use
REQUEST.SESSION.get('firstName')<BR><BR>What my question is, is there anyway
to directly access "first_name" from the form in the python script without
having to have to call the <dtml-call " REQUEST.SESSION.set('firstName',
first_name)> and then REQUEST.SESSION.get('firstName') in the python
script. Sort of a sophomoric question, but any help would be
appreciated. Thanks in advance.<BR><BR>-Muk<BR>
<P>
<HR>
<P></P>_______________________________________________<BR>Zope maillist
-
Zope@zope.org<BR>http://mail.zope.org/mailman/listinfo/zope<BR>**
No cross posts or HTML encoding! **<BR>(Related lists -
<BR> http://mail.zope.org/mailman/listinfo/zope-announce<BR> http://mail.zope.org/mailman/listinfo/zope-dev
)<BR></BLOCKQUOTE></BODY></HTML>