[Zope] Newbie CGI question

Dieter Maurer dieter@handshake.de
Thu, 22 Jun 2000 08:56:27 +0200 (CEST)


jholland@gears.linuxave.net writes:
 > How can I access the variables passed into a DTML called as a Form by
 > another DTML? it has the usual ?x=1&y=2 ... stuff - I'd really like to loo
 > through these.
Usually, between DTML1 (creating the form) and DTML2 (accessing the
form content) is the WWW browser.

I assume this familiar setup (tell me, in case I am wrong):

  you find the form content in the dictionary "REQUEST.form".
  Its content is automatically imported in the DTML namespace.
  Thus, you can simply access it like DTML variables
  (e.g. <dtml-var x>).

  If there are other variables with the same name,
  you could use something like:

	<dtml-call "REQUEST['x']">

  or even

       <dtml-call "REQUEST.form['x']">


 > Also can I construct a string and then evaluate it? ie
 > 
 > varname="therealvar" + "name"
 > 
 > <some sort of eval> varname
You have restricted evaluation capabilities:

	<dtml-var "expression">

e.g.

	<dtml-var "x+y">	computes "x + y"
	<dtml-var "_[name]">	renders the DTML var whose
				name is given by the variable "name".
        <dtml-var "REQUEST[name]">
			        look up the REQUEST variable
				whose name is given by "name".

You should read the DTML User Guide (--> zope.org->Documentation)
to learn more.



Dieter