Return-Path: Delivered-To: apmail-httpd-apreq-dev-archive@www.apache.org Received: (qmail 98154 invoked from network); 22 Sep 2006 18:03:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Sep 2006 18:03:51 -0000 Received: (qmail 48676 invoked by uid 500); 22 Sep 2006 18:03:51 -0000 Delivered-To: apmail-httpd-apreq-dev-archive@httpd.apache.org Received: (qmail 48549 invoked by uid 500); 22 Sep 2006 18:03:50 -0000 Mailing-List: contact apreq-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list apreq-dev@httpd.apache.org Received: (qmail 48538 invoked by uid 99); 22 Sep 2006 18:03:50 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Sep 2006 11:03:49 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=daveviner@pobox.com; spf=unknown X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received-SPF: unknown (idunn.apache.osuosl.org: domain pobox.com does not designate 68.142.206.236 as permitted sender) Received: from [68.142.206.236] ([68.142.206.236:38579] helo=smtp103.plus.mail.mud.yahoo.com) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id BE/F1-06791-67524154 for ; Fri, 22 Sep 2006 11:03:39 -0700 Received: (qmail 67868 invoked from network); 22 Sep 2006 18:02:42 -0000 Received: from unknown (HELO ?192.168.10.33?) (daveviner@72.245.12.66 with plain) by smtp103.plus.mail.mud.yahoo.com with SMTP; 22 Sep 2006 18:02:41 -0000 Mime-Version: 1.0 (Apple Message framework v752.2) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: apreq-dev@httpd.apache.org From: Dave Viner Subject: use libapreq2 to read POST params Date: Fri, 22 Sep 2006 11:03:40 -0700 X-Mailer: Apple Mail (2.752.2) X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, I'm trying to use libapreq2 to read some parameters submitted via POST, but I'm having trouble. Should I use $req->body($myparam) ? or $req->param($myparam)? My code looks like this: $r->log->debug("Testing param"); my ($md5, $entered); eval { $md5 = $req->param('cv'); } ; if($@) { use Data::Dumper; $r->log->error("ACK: no cv param: " . $@->strerror() . " -- " . Dumper($@)); return $class->handle_get($r, $Site, $req, 'The code entered was not valid.
Please try again.'); } $r->log->debug("For cv got... $md5"); The error log shows the following: [Fri Sep 22 10:59:56 2006] [debug] /Users/dviner/Documents/amb/dev/ aboutmybaby/AMB/Handlers/GuestbookSign.pm(57): [client 127.0.0.1] Testing param [Fri Sep 22 10:59:56 2006] [debug] filter.c(269): [client 127.0.0.1] prefetching 65536 bytes Use of uninitialized value in concatenation (.) or string at /Users/ dviner/Documents/amb/dev/aboutmybaby/AMB/Handlers/GuestbookSign.pm line 67. [Fri Sep 22 10:59:56 2006] [debug] /Users/dviner/Documents/amb/dev/ aboutmybaby/AMB/Handlers/GuestbookSign.pm(67): [client 127.0.0.1] For cv got... The request I sent is as follows: $ cat sign.params | lwp-request -m POST -SUsue "http:// lalala.aboutmybaby.localhost/guestbook/sign" $ cat sign.params gbentry_from=hithere&gbentry_body=foobar&cv=1111111&cg=abcdef $ Here are the details of my installation: [Fri Sep 22 10:59:55 2006] [notice] Apache/2.0.58 (Unix) PHP/5.1.4 DAV/2 mod_apreq2-20051231/2.6.0 mod_perl/2.0.2 Perl/v5.8.8 configured -- resuming normal operations Thanks for your help. Dave Viner