Tom
Where's @params coming from ?
Are you sure it's not empty ?
Swen
|-+>
| | "Tom Gazzini"|
| | <[EMAIL PROTECTED]|
| | uk> |
| ||
| | 06/26/2003 04:42 |
| | PM |
| ||
|-+>
>--|
|
|
| To: <[EMAIL PROTECTED]>
|
| cc:
|
| Subject: Question about Apache::Request and query strings
|
|
|
|
|
>--|
I have a perl function which, amongst other things, needs to redirect
the request to another page.
It also needs to pass all the query parameters of the original request
(both GET and POST) to the redirected page, and also add one parameter
of it's own (an error message).
Sounds simple enough, but I'm having problems with the passing paramters
bit.
Here's what I have:
sub show_error {
my ($r, $error) = @_;
# $r is an Apache:Request object passed by the caller
my $uri = URI->new($url);
foreach my $p (@params) {
$uri->query_form($p => $r->param($p));
}
$uri->query_form(error => $error);
$r->internal_redirect($uri->canonical);
}
But this doesn't work. The '?error=' query string gets passed, but the
orginal request query strings don't.
What am I doing wrong? And is there an easier way?
Thanks,
Tom