Forum OpenACS Development: Getting a Return Path
I'm looking to put a 'return' link into a couple of pages which can be called from several locations.
Is there a handy proc which will help me out here or do I have to pass the return path in the request?
set return_url [ad_conn url]?[ad_conn query]
will get you a url that references the current page. Pass it using export_vars if you're generating a hypertext link or in the -export clause to ad_form if you're building a form that needs to include the return address.
Setting return_url is what I'd come up with. Hadn't thought of grepping the the source for it but doing so seems to confirm this.
Nice to know I wasn't missing anything.
Doesn't your ad_return_url already handle this? Something like:
set current_url [ad_return_url -urlencode]
Although ad_return_url does make use of ns_conn rather than ad_conn which may differ in result in host node map on [ns_conn url] and possibly some other situations too.