perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Easy internal redirect question
Date Wed, 02 Oct 2002 19:19:16 GMT

I've got a bit of a better grasp on the problem now....I think it's an
interaction with POST data...

I have a form in foo.html....

<form action="/rms/admin" method=post> 
<input type=hidden name=task value=process_config>
...other form fields...

I submit this form, and in /rms/admin, it gets handled like this....

# suck in form values, stick them in objects, blah blah, then get to the

and what happens is that /rms/status complains that it doesn't know how to
handle task=process_config.  So, somehow the value for 'task' that was
POSTed in the first request from the form gets passed onto the second
request, apparently overriding the 
'task' value of 'display' which I am trying to set in the url string I'm
giving to internal_redirect().

I don't want any of the POST data to get passed onto that redirect.  Any
thoughts?  I saw a note in the API docs that $r->args() can be used to set
the query string and that this is useful when redirecting POST requests.  I
tried doing a $r->args('task=display') right before the call to
internal_redirect, but no luck. 


-----Original Message-----
From: Geoffrey Young []
Sent: Wednesday, October 02, 2002 1:06 PM
Subject: Re: Easy internal redirect question wrote:
> I call a page, /my/script1?task=foo which does some things and then needs
> redirect to /my/script2?task=bar.  However, putting 
> $r->internal_redirect('/my/script2?task=bar');
> doesn't seem to work as script2 is seeing task=foo rather than task=bar.
> Looks like the internal_redirect is also passing along the form params to
> the second request.  How is this avoided?  I'm looking through the
> recipe on internal redirects but nothing is jumping out at me at the

that's pretty odd.

given two scripts,

return Apache::OK;


my $r = shift;
print "args is ", scalar $r->args, "\n";

I get the right results:

$ GET localhost/perl-bin/
args is internal=redirect

are you returning OK right after your internal redirect?  does setting 
$r->args() before calling the internal redirect to a third value 
change anything?


View raw message