Forum OpenACS Q&A: Re: ad_returnredirect

Collapse
3: Re: ad_returnredirect (response to 2)
Posted by Tilmann Singer on
Doing a

ad_returnredirect "http://www.google.com"

works for me. Maybe you are not getting the value in $page_link that you expect? If it is an empty string then the redirect will go to the index page of the current location I think.

You could for example try to replace

ad_returnredirect $page_link

with

doc_return 200 text/plain "page_link is: $page_link"

to see what it contains.

Collapse
4: Re: ad_returnredirect (response to 3)
Posted by Jason Simpson on
i get a value for $page_link

when i do doc_return 200 text/plain "page_link is: $page_link" i get the url showing

however, when i do

ns_write $page_link

before redirecting I get nothing, but if I do:

ns_write "test"
ns_write $page_link

i get 'hello' followed by the link

so it seems that ad_returnredirect $page_link will not detect the value of $page_link, but anything else (i.e. ns_returnredirect $page_link will detect it)

if i do ad_returnredirect "http://www.google.com" it sends the page to Google correctly

is this an error with ad_returnredirect? or just me?

Collapse
5: Re: ad_returnredirect (response to 4)
Posted by Jason Simpson on
figured it out...finally!!!

was truncating the page_link before inserting into database, so link was never correct