Redirect to another run mode with CGI::Application
Redirect to another run mode with CGI::Application
This tutorial is about how to redirect the user to another 'page' using CGI::Application.
First read the CGI::Application tutorial if you don't know how the module works.
In the beginning of the run mode subroutine, create a new CGI query object (which I guess you do anyway):
Anywhere in the run mode subroutine, you can insert the following code:
(previous code in this run mode)
.
.
.
if ($we_need_to_redirect)
{
my$this_url = $q->script_name();
my$other_run_mode = 'another_run_mode';
my$redirect_url=$this_url.'?rm='.$other_run_mode;
$self->header_type('redirect');
$self->header_props(-url => $redirect_url);
return;
}
.
.
.
(more code in this run mode)
Last modified: Mon Jan 22 17:18:08 Romance Standard Time 2007