Home
The Toolkit for Online Communities
17514 Community Members, 3 members online, 2346 visitors today
Log In Register
OpenACS Home : ACS API Browser : ad_returnredirect

ad_returnredirect (public)

 ad_returnredirect [ -message message ] [ -html ] \
    [ -allow_complete_url ] target_url
Defined in packages/acs-tcl/tcl/utilities-procs.tcl

Write the HTTP response required to get the browser to redirect to a different page, to the current connection. This does not cause execution of the current page, including serving an ADP file, to stop. If you want to stop execution of the page, you should call ad_script_abort immediately following this call.

This proc is a replacement for ns_returnredirect, but improved in two important respects:

  • When the supplied target_url isn't complete, (e.g. /foo/bar.tcl or foo.tcl) the prepended location part is constructed by looking at the HTTP 1.1 Host header.
  • If an URL relative to the current directory is supplied (e.g. foo.tcl) it prepends location and directory.

Switches:
-message (optional)
A message to display to the user. See util_user_message.
-html (boolean) (optional)
Set this flag if your message contains HTML. If specified, you're responsible for proper quoting of everything in your message. Otherwise, we quote it for you.
-allow_complete_url (boolean) (optional)
By default we disallow redirecting to urls outside the current host. This is based on the currently set host header or the host name in the config file if there is no host header. Set allow_complete_url if you are redirecting to a known safe external web site. This prevents redirecting to a site by URL query hacking.
Parameters:
target_url

See Also:
[ show source ]
Show another procedure: