[Zope] how do you do dynamic redirection?

Nick Garcia ngarcia@codeit.com
Thu, 09 Mar 2000 16:16:16 -0800


Graham Chiu wrote:
> 
> I would like to redirect a user based upon a variable.
> 
> <dtml-call "RESPONSE.redirect(/target?myvariable=xyz)">
> 
> raises a syntax error.  Does the redirect command only take literals?

redirect takes string.  The correct syntax would be:

<dtml-call "RESPONSE.redirect('/target?myvariable=%s' % xyz)">

Remember, once inside quotes ("") you're writing Python code.

-- 
Nick Garcia | ngarcia@codeit.com
CodeIt Computing | http://codeit.com