[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: perl code to handle a multipart/form-data POST
From:       Tobias Hoellrich <thoellri () Adobe ! COM>
Date:       2000-04-30 18:09:48
[Download RAW message or body]

At 01:49 PM 4/30/00 -0400, Sam Carleton wrote:
>
>Tobias,
>
>I am looking into it right now, but you might be able to save me a lot
>of time.  I want to display the name/values from the HTML form.  How
>would I go about enumerating through the @params to do this?
>
>Sam

How bout this:

package Apache::POSTDisplay;
use strict;
use Apache::Constants qw(:common);
use Apache::Request ();
use Apache::Util ();
sub handler {
    my $r = shift;
    my $apr=Apache::Request->new($r);
    $r->content_type('text/html');
    $r->send_http_header;
    return OK if $r->header_only;
    my
$html=qq{<html><body><title>POSTDisplay</title><body><h1>POSTDisplay</h1><ul>};
    foreach my $key ($apr->param) {
      my $val=Apache::Util::escape_html($apr->param($key));
      $html.=qq{<li>[$key] = [$val]\n};
    } 
    $html.=qq{</ul>\n</body>\n};
    $r->print($html);
    return OK;    
}
1;

Tobias

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic