[Zope] Simple Problem (SESSION)
DA Loeffler
David.Loeffler@bristol.ac.uk
Tue, 6 Aug 2002 09:56:23 +0100 (BST)
This seems to work:
<dtml-var standard_html_header>
<dtml-unless "REQUEST.SESSION.has_key('foo')">
<dtml-call "REQUEST.SESSION.set('foo',0)">
</dtml-unless>
<dtml-call "REQUEST.SESSION.set('foo', REQUEST.SESSION['foo']+1)">
<h2><dtml-var title_or_id></h2>
<p>
You have visited this page <dtml-var "REQUEST.SESSION['foo']"> times.
</p>
<dtml-var standard_html_footer>
(The attributes of SESSION are listed in the API Reference under
TransientObject (of which it is an instance). But it behaves more or
less as a dictionary.)
HTH
David
On Tue, 6 Aug 2002, Rares Vernica wrote:
> Hi,
>
> How can I make a page, in Zope, that when it is opened in print "1" and
> every time the user refresh the page the number increments itself (2, 3,
> ...), using SESSION?
>
> Thanks in advance,
> Rares
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> 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 )
>
>