[Zope] Newbie question: HTTP variables

Michael Bernstein webmaven@lvcm.com
Sat, 13 Jan 2001 02:38:34 -0800


Dean & Deb Ekstrand wrote:
> 
> I'm trying to figure out Zope (on a time crunch, too), and I'm wondering how
> to do something.  How can I access HTTP variables in my DTML code?
> Specifically, I want to return code specific to the user's browser.  I know
> that HTTP has provisions for determing browser version, are those accessible
> in DTML and how?  If they are not accessible in DTML, is there a workaround
> (without oodles of javascript)?

these variables are part of the REQUEST namespace.
Specifically you can do

<dtml-var "REQUEST.HTTP_USER_AGENT"> to display the browswer
version. Creating conditional code is left as an excersize
for the student.

If you want to display a complete list of all HTTP REQUEST
variables, try this:

<dtml-var REQUEST>

> Another quick question:  I see that Zope 2.3 will have "Script" objects.
> What's the closest I can come in Zope 2.2.5?

The Python Method product:
http://www.zope.org/Members/4am/PythonMethod

Or external methods:
http://www.zope.org/Documentation/How-To/ExternalMethods

HTH,

Michael Bernstein