Great Kip, it all works - and a +1 from me for a CPAN plugin.
A gotcha - my directory for plugins is called "Plugins" (as per AxKit
install) whereas your sample code has the package in "Plugin".
Many thanks
Dave
----------%<--------------------------------
package Apache::AxKit::Plugins::SetUserAgent;
use strict;
use Apache::Constants;
use Apache::Request;
sub handler {
my $r = shift;
my $agent = $ENV{HTTP_USER_AGENT};
my $cgi = Apache::Request->instance($r);
$cgi->parms->set('UserAgent' => $agent);
return OK;
}
1;
----------%<--------------------------------
At 17:16 11/03/2002 -0500, Kip Hampton wrote:
>I have one that I use here to pass the request URI using the same
>method:
>
>----------%<--------------------------------
>package Apache::AxKit::Plugin::URIasParam;
>
>use strict;
>use Apache::Constants;
>use Apache::Request;
>
>sub handler {
> my $r = shift;
> my $uri = $r->uri;
> my $cgi = Apache::Request->instance($r);
> $cgi->parms->set('_axkit-uri' => $uri);
> return OK;
>}
>
>1;
>----------%<--------------------------------
>
>This makes the URI string available to my XSLT stylesheets via
><xsl:param name="_axkit_uri"/>, you could do the same for the UA string.
>
>Now that i think about it... are the request/server/environment vars
>something that folks will want, in general, to be available to their
>stylesheets? If so, and I get enough "+1"s here, I'd be willing to ram
>out and CPAN a Plugin that does all that stuff...
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]