At 01:29 PM 4/30/00 -0400, Sam Carleton wrote:
>
> Ok, So cgi-lib.pl isn't the greatest in the world, but it did help me
> get a big farther in my project:) Now I need something that works. I
> have "Writing Apache Modules with Perl and C", but have not read too
> deep into it and time is very short. Again, all I am trying to do is
> print out ALL the name/values that was on the form. The code I have so
> far does not display any of the name/values, Below is my code, could
> someone please show me what I am doing wrong and how do I fix it?
>
> package Apache::POSTDisplay;
>
> use strict;
> use Apache::Constants qw(:common);
>
> sub handler {
> my $r = shift;
>
> $r->content_type('text/html');
> $r->send_http_header;
> $r->print(<<HTTP_HEADER);
>
>
> POSTDisplay
>
>
> HTTP_HEADER my @args = ($r->args, $r->content); while(my($name,$value) =
> splice @args,0,2) { $r->print("
> * [$name]=[$value]\n"); } $r->print(<
> * </HTML> HTTP_FOOTER
>
> return OK; }
>
> 1; __END__
Almost :-) Apache cannot be used for multipart/form-data, gotta use
Apache::Request instead. Change the start of the handler to :
sub handler {
my $r = shift;
my $apr = Apache::Request->new($r)
and then get the params with @params=$apr->param;
Hope this helps
Tobias