how do you do dynamic redirection?
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? ------- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.com/dynamo - The Homebuilt Dynamo http://www.compkarori.com/dbase - The dBase bulletin
On Fri, Mar 10, 2000 at 12:37:17PM +1300, 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?
No, it takes a string. Try: <dtml-call "RESPONSE.redirect('/target?myvariable=xyz')"> -Petru
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
In article <38C83ED0.5A6BF12E@codeit.com>, Nick Garcia <ngarcia@codeit.com> writes
<dtml-call "RESPONSE.redirect('/target?myvariable=%s' % xyz)">
Ah, that's what I need.
Remember, once inside quotes ("") you're writing Python code.
I have what seems a rather increasingly futile wish to avoid overloading my brain by learning Python :-( ------- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.com/dynamo - The Homebuilt Dynamo http://www.compkarori.com/dbase - The dBase bulletin
participants (3)
-
Graham Chiu -
Nick Garcia -
Petru Paler