perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex" <>
Subject RE: Help about $r->content( )
Date Wed, 01 Mar 2000 20:45:09 GMT
This message was sent from by "Alex" <>
Be sure to reply to that address.

> Duh.
> > At first time I send a GET to Apache server, this 
> > returns a page with a form in then a user submiti 
> > it by POST to the same module with some data.
> > The problem is that seems to be reading but the 
> > server doesn't answer to the client.
> > 
> > Anyone can help me?
> Can you post some code?
> $r->args will read the query string (for GET requests)
> $r->content will read the data from a POST.
> This is code a lot of people use:
> 	my %params = $r->method eq 'POST' ? $r->content : $r->args;
> --
> Eric

Yes, here it is :

sub handler
  my $req=shift;
  #my %params=$req->content;       I've used for tests
  my $params=$req->content;

#  my $user=$params{username};
#   my $pass=$params{password};

   open(ARQ, ">>/usr/local/apache/logs/test.dat");
   print ARQ "$paramsn";
   print ARQ $req->method."n";
   close ARQ;

   return 306;

When I submit the form I get the following alert message, after timeout:
'The server returned an invalid or unrecognized response' 

Note that I have a page with a form that activates this simple module and I have one directive

ErrorDocument 306 /error.htm in httpd.conf, another observation is that when I change the

method in the form from POST to GET using $r->args inside the module, it works. But I need
do that using POST. Another thing, when I donīt call $r->content() it works too!


Alex - The Knowledge Archive

View raw message