Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 35920 invoked from network); 7 Oct 2007 14:19:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Oct 2007 14:19:27 -0000 Received: (qmail 11435 invoked by uid 500); 7 Oct 2007 14:19:11 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 11417 invoked by uid 500); 7 Oct 2007 14:19:11 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 11406 invoked by uid 99); 7 Oct 2007 14:19:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Oct 2007 07:19:11 -0700 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sdavis2@mail.nih.gov designates 128.231.90.107 as permitted sender) Received: from [128.231.90.107] (HELO nihrelayxway2.hub.nih.gov) (128.231.90.107) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Oct 2007 14:19:12 +0000 X-IronPortListener: NIH_Relay X-SBRS: None X-IronPort-AV: E=Sophos;i="4.21,240,1188792000"; d="scan'208";a="326631286" Received: from vpn-165-112-42-58.net.nih.gov (HELO csrmulhersa.nih.gov) ([165.112.42.58]) by nihrelayxway2.hub.nih.gov with ESMTP; 07 Oct 2007 10:18:51 -0400 Message-ID: <4708EACA.8090005@mail.nih.gov> Date: Sun, 07 Oct 2007 10:18:50 -0400 From: Sean Davis User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: newgaton new CC: Perrin Harkins , modperl@perl.apache.org Subject: Re: [mp2] how to add data to posted form? References: <3909957a0710060035r3321fa8bya1d4cec8bc27a0ac@mail.gmail.com> <66887a3d0710061554qde07846oaed48d45da91e1f0@mail.gmail.com> <3909957a0710062352o46c3a931ma8e2484bc109dab0@mail.gmail.com> In-Reply-To: <3909957a0710062352o46c3a931ma8e2484bc109dab0@mail.gmail.com> Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org newgaton new wrote: > > > 2007/10/7, Perrin Harkins >: > > On 10/6/07, newgaton new > wrote: > > i have a question. i am coding a program. i must change / add some > > data to posted form from browser . > > What are you trying to do? Using the parsed request data as a place > to store your own global data is a bad idea. If you just want to > store something in a convenient place, use $r->pnotes. If you want to > trick some legacy code that you can't change into receiving modified > parameters, use an input filter. If you're trying to trick some some > code that you can change, just change the code instead to get its > parameters from a method you provide. > > - Perrin > > > thanx very much to reply my question, I wanna find a interface to add some > data to form (or maybe I will make a form in handler) which is posted > from > a browser. I am doing some job like the > Module Apache::ParseFormData . now I don't know how to change or add > the form > data. > > for instance browser send some form data including some input element, > now > I wanna add some input element to it in server side, I know the data > format is > another style in server side. now I can't find the interface to add > data to form. > I would read the form data on the server side into perl data structures. Then, you can simply add to the perl data structures. I know this sounds like an obvious solution, but that is the way that web applications work. If you are asking about how to change what is in the form on the browser, you cannot do that once the form has been submitted without regenerating the HTML and sending it back to the browser (or doing some AJAX calls from the browser, which is likely to be more complicated). Sean