in reply to Problem with getting POST request data with Apache::Request object

Please post a minimal working example that demonstrates the problem you are having. The reason for providing the minimal working example is that without it we will sometimes assume things about the other areas of the code that are incorrect.

Also, some additional context information would help. Are you running this as a script using Apache::Registry, or as a separate apache module? Please provide the relevant portion of your apache config file. For example:

<Location /foo> SetHandler perl-script PerlHandler Apache::Registry Options +ExecCGI PerlSendHeader On </Location>
  • Comment on Re: Problem with getting POST request data with Apache::Request object
  • Download Code

Replies are listed 'Best First'.
Re^2: Problem with getting POST request data with Apache::Request object
by thil (Sexton) on Aug 08, 2006 at 13:03 UTC

    Here's the full program that i was trying to run and the HTML content.

    use Apache::Request; use CGI; my $apr= Apache::Request->new(shift); my $page = new CGI; my $test=$apr->param('school'); print $page->header(); print("Post Data " . $test);

    HTML content

    <html> <head></head> <body> <form method=Post action='test.pl' > <input type=text name='school' value='test'> <input type=submit value='Ok'> </form> </body> </html>

    mod_perl configuration in http.conf

    Alias /perl/ /usr/local/apache/cgi-bin/ PerlModule Apache::Registry <Location /perl/> SetHandler perl-script PerlHandler Apache::Registry Options +ExecCGI PerlSendHeader On allow from all </Location>

    Apache version is 1.3.
      Try this instead, see what happens:
      my $test = $page->param('school');

      ---
      It's all fine and dandy until someone has to look at the code.

        Yes, I could access the POST data using the CGI object.
        That is,
        my $test = $page->param('school');
        gave me the result - 'test'.

        Thilani