[Zope] redirect page with variables

Stuart Bishop zen@shangri-la.dropbear.id.au
Fri, 12 Apr 2002 12:41:33 +1000


On Thursday, April 11, 2002, at 08:01  PM, Horvath Adam wrote:

>> From a form I have a lot of form variabes in the REQUEST
> object. The form processing method modify this form
> variables and set some new one in the REQUEST object.
> After it I'd like to redirect page with this modified
> variables.
> Can I append REQUEST variables to this command?
> <dtml-call "REQUEST.RESPONSE.redirect(pagename)">

You cannot do this with pure DTML. You need to use
Python, calling urllib.urlencode( {'field': 'value','field2': 'value'} )
to build a string that can be appended to your URL.

> Or I have to append to pagename the name and
> value of the variables one after the other?

Yes - the simplest way is using an external method and the
urllib.urlencode function to do this. You can find all the
arguments submitted to your script in REQUEST.form which
can make things simpler.
--
Stuart Bishop <zen@shangri-la.dropbear.id.au>
http://shangri-la.dropbear.id.au/