HowTo: trying to acces only the form elements in the REQUEST ...
Hello everyone, I need a quick hint. How do I check wether there are any "form" elements in the request. And how can I only acces those ? I want to pass those, and only thos on to a ZClient call to another website. I do have a request like this: http://server/foo/bar?name=bar¶m=foo¶m2=baz Now I want to isolate name, param and param2. I need to construct a request like this: <dtml-if <any parameters at all>> <dtml-in <all form parameters in REQUEST>> ..... do something </dtml-in> </dtml-if> TIA Holger -- ----------------------------------- catWorkX GmbH Dipl.-Ing. Holger Lehmann Stresemannstr. 364 22761 Hamburg Tel: +49 (0700) catWorkX Tel: +49 (40) 890 646-0 Fax: +49 (40) 890 646-66 mailto:lehmann@catworkx.de http://www.catworkx.de http://www.catbridge.de
Holger Lehmann <lehmann@catworkx.de> writes:
Hello everyone,
I need a quick hint.
How do I check wether there are any "form" elements in the request. And how can I only acces those ? I want to pass those, and only thos on to a ZClient call to another website.
I do have a request like this: http://server/foo/bar?name=bar¶m=foo¶m2=baz
Now I want to isolate name, param and param2. I need to construct a request like this: <dtml-if <any parameters at all>> <dtml-in <all form parameters in REQUEST>> ..... do something </dtml-in> </dtml-if>
Some hints to play with (tested on 2.3.0): <dtml-if "REQUEST.form"> <dtml-var "REQUEST.form"><br> <dtml-var "REQUEST.form.keys()"><br> <dtml-var "REQUEST.form.values()"><br> <dtml-var "REQUEST.form.items()"><br> <dtml-in "REQUEST.form.items()"> <br><dtml-var sequence-index>: <dtml-var sequence-key>=<dtml-var sequence-item> </dtml-in> <dtml-else> No parameters given! </dtml-if> Regards Siggy -- Siggy Brentrup - bsb@winnegan.de - http://www.winnegan.de/ ****** ceterum censeo javascriptum esse restrictam *******
<dtml-if "REQUEST.form"> <dtml-if "REQUEST.form.has_key('bar') and REQUEST.form.has_key('baz')"> ... do something... </dtml-if> </dtml-if> ----- Original Message ----- From: "Holger Lehmann" <lehmann@catworkx.de> To: "Zope devel list" <zope-dev@zope.org> Sent: Tuesday, March 13, 2001 3:33 AM Subject: [Zope-dev] HowTo: trying to acces only the form elements in the REQUEST ... Hello everyone, I need a quick hint. How do I check wether there are any "form" elements in the request. And how can I only acces those ? I want to pass those, and only thos on to a ZClient call to another website. I do have a request like this: http://server/foo/bar?name=bar¶m=foo¶m2=baz Now I want to isolate name, param and param2. I need to construct a request like this: <dtml-if <any parameters at all>> <dtml-in <all form parameters in REQUEST>> ..... do something </dtml-in> </dtml-if> TIA Holger -- ----------------------------------- catWorkX GmbH Dipl.-Ing. Holger Lehmann Stresemannstr. 364 22761 Hamburg Tel: +49 (0700) catWorkX Tel: +49 (40) 890 646-0 Fax: +49 (40) 890 646-66 mailto:lehmann@catworkx.de http://www.catworkx.de http://www.catbridge.de _______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
participants (3)
-
Chris McDonough -
Holger Lehmann -
Siggy Brentrup