Re: [Zope] Newbie CGI question

2000-06-22 Thread Dieter Maurer

[EMAIL PROTECTED] writes:
  How can I access the variables passed into a DTML called as a Form by
  another DTML? it has the usual ?x=1y=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

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Newbie CGI question

2000-06-21 Thread Patrick Lewis

Not sure this is what you are looking for, but here it goes:

On Wed, Jun 21, 2000 at 09:38:30AM -0700, [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 How can I access the variables passed into a DTML called as a Form by
 another DTML? it has the usual ?x=1y=2 ... stuff - I'd really like to loo
 through these.

I assume you have two fields in your form, like this:

form action="foo_dtml" method="POST"
  input type="text" name="x"
  input type="text" name="y"
  ...
/form

Then, in foo_dtml, you would display them as:

dtml-var x dtml-var y

Easy so far.

 
 Also can I construct a string and then evaluate it? ie
 
 varname="therealvar" + "name"
 
 some sort of eval varname
 
 that would return the contents of the variable "therealvarname".

I think this is what you are looking for:

dtml-let varname=" 'therealvar' + 'name' "
  !-- varname should now be equal to 'therealvarname' --
  dtml-var varname
/dtml-let

-- 
Patrick Lewis [EMAIL PROTECTED]

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )