<!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>What does "it doesn't seem to work" mean?
Error messages/traceback? What does your form & script contain? More
info on the problem is definitely required!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jonathan</FONT></DIV>
<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=dev101@magma.ca
href="mailto:dev101@magma.ca">Jonathan</A> ; <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 4:20
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Zope] Python Scripts and
HTML Forms</DIV>
<DIV><BR></DIV>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="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<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="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px"></BLOCKQUOTE></DIV>
<DIV><SPAN class=e id=q_10d1d899fbd963c7_1>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal">-----
Original Message ----- </DIV>
<DIV
style="BACKGROUND: rgb(228,228,228) 0% 50%; FONT: 10pt arial; font-size-adjust: none; font-stretch: normal; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"><B>From:</B>
<A title=myan@umich.edu
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:myan@umich.edu" target=_blank>Muk Yan</A> </DIV>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>To:</B>
<A title=zope@zope.org
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:zope@zope.org" target=_blank>zope@zope.org</A> </DIV>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>Sent:</B>
Thursday, August 17, 2006 2:57 PM</DIV>
<DIV
style="FONT: 10pt arial; 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
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Zope@zope.org" target=_blank>Zope@zope.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://mail.zope.org/mailman/listinfo/zope"
target=_blank>http://mail.zope.org/mailman/listinfo/zope</A><BR>**
No cross posts or HTML encoding! **<BR>(Related lists - <BR> <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://mail.zope.org/mailman/listinfo/zope-announce"
target=_blank>http://mail.zope.org/mailman/listinfo/zope-announce</A><BR> <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://mail.zope.org/mailman/listinfo/zope-dev" target=_blank>
http://mail.zope.org/mailman/listinfo/zope-dev</A> )<BR>
<P></P></DIV></DIV></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></BODY></HTML>