<!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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>REQUEST&nbsp;= 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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>fname = REQUEST['first_name']</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial><FONT size=2>or</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2></FONT></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial><FONT size=2></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial><FONT size=2>hth</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial><FONT size=2>Jonathan</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2></FONT>&nbsp;</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>&lt;form action="process_this_form" 
  method="post"<BR><BR>Name:&lt;input type="text" 
  name:"first_name"&gt;<BR><BR>&lt;/form&gt; <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>&lt;dtml-call "REQUEST.SESSION.set ('firstName', 
  first_name)&gt;<BR>&lt;dtml-call "this_is_a_python_script()"&gt;<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 &lt;dtml-call " REQUEST.SESSION.set('firstName', 
  first_name)&gt; and then REQUEST.SESSION.get('firstName') in the python 
  script.&nbsp; Sort of a sophomoric question, but any help would be 
  appreciated.&nbsp; Thanks in advance.<BR><BR>-Muk<BR>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Zope maillist&nbsp; 
  -&nbsp; 
  Zope@zope.org<BR>http://mail.zope.org/mailman/listinfo/zope<BR>**&nbsp;&nbsp; 
  No cross posts or HTML encoding!&nbsp; **<BR>(Related lists - 
  <BR>&nbsp;http://mail.zope.org/mailman/listinfo/zope-announce<BR>&nbsp;http://mail.zope.org/mailman/listinfo/zope-dev 
  )<BR></BLOCKQUOTE></BODY></HTML>