Hey Jonathan, All,<br>
<br>
Thanks I tried your solution, but it doesn't seem to work. Can anybody
shed some more light on this situation, since what Jonathan provides is
exactly what I want to do, but it's not working.<br>
<br>
Am I forgetting to put parameteres or some other newbie mistake like that?<br>
<br>
Thanks in advance and thanks again Jonathan.<br>
<br>
-Muk<br><br><div><span class="gmail_quote">On 8/17/06, <b class="gmail_sendername">Jonathan</b> <<a href="mailto:dev101@magma.ca">dev101@magma.ca</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div 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> </font></div>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;"></blockquote></div><div><span class="e" id="q_10d1d899fbd963c7_1">
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">----- Original Message ----- </div>
<div style="background: rgb(228, 228, 228) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<b>From:</b>
<a title="myan@umich.edu" href="mailto:myan@umich.edu" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Muk Yan</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b> <a title="zope@zope.org" href="mailto:zope@zope.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
zope@zope.org</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> Thursday, August 17, 2006 2:57
PM</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><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>
</span></div><div><p>
</p><hr>
<p></p>_______________________________________________<br>Zope maillist
-
<a href="mailto:Zope@zope.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Zope@zope.org</a><br><a href="http://mail.zope.org/mailman/listinfo/zope" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://mail.zope.org/mailman/listinfo/zope</a><br>**
No cross posts or HTML encoding! **<br>(Related lists -
<br> <a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mail.zope.org/mailman/listinfo/zope-announce</a><br> <a href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://mail.zope.org/mailman/listinfo/zope-dev</a>
)<br><p></p></div>
</div></blockquote></div><br>