You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jonathan <mo...@2xlp.com> on 2005/11/01 00:14:54 UTC

POST vs GET

Background Running: current stable of mp2 and libapreq-devel

Problem:
     I'm allowing GET style urls to forms for pre-population
     If the POST action is dirty though, i get cross contamination of  
vars IF there was a NULL action in the form

     ie:
         url:
           message.cgi?email=user@domain.com&subject=hello
         becomes form:
           {form action="" method=POST"}
           email: [ user@domain.com]
           subject: [ hello ]
           body: []
          {/form}

     if i submit that, then it submits the POST data (as it should)  
to the url message.cgi?email=user@domain.com&subject=hello

    when i access that info with ->param('fieldname'), the url data  
in the get string takes precedence and ignores the POST

obviously, the correct recourse is to go through all of my templates,  
make sure that there is a valid and specified page that the action is  
posting to, and yell at those who left those fields blank in  
templates they gave to me.

but, can i hope (can i? seriously.) that there is some mechanism in  
mp2/libapreq that will let me explcitly choose whether param is  
pulling POST or GET data for a given fieldname - so i can put a  
temporary solution in place?  because I really not in a template- 
fixing mood right now , and i'd rather just use some code until later.


Re: POST vs GET

Posted by Jonathan <jv...@2xlp.com>.
On Oct 31, 2005, at 6:29 PM, Joe Schaefer wrote:

>> pulling POST or GET data for a given fieldname
> In place of param(), use the body() or args() methods, respectively.

Simple and stupid enough.  Many thanks!


Re: POST vs GET

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Jonathan <mo...@2xlp.com> writes:

> but, can i hope (can i? seriously.) that there is some mechanism in  
> mp2/libapreq that will let me explcitly choose whether param is  
> pulling POST or GET data for a given fieldname

In place of param(), use the body() or args() methods, respectively.

-- 
Joe Schaefer


Re: POST vs GET

Posted by Jeff <mo...@aquabolt.com>.
> Background Running: current stable of mp2 and libapreq-devel
> 
> Problem:
>     I'm allowing GET style urls to forms for pre-population
>     If the POST action is dirty though, i get cross contamination of 
> vars IF there was a NULL action in the form
> 
>     ie:
>         url:
>           message.cgi?email=user@domain.com&subject=hello
>         becomes form:
>           {form action="" method=POST"}
>           email: [ user@domain.com]
>           subject: [ hello ]
>           body: []
>          {/form}
> 
>     if i submit that, then it submits the POST data (as it should) to 
> the url message.cgi?email=user@domain.com&subject=hello
> 

Why not just remove the GET from submission, using

   { form action="message.cgi" method="POST" }

regards
Jeff


Re: POST vs GET

Posted by Jonathan <mo...@2xlp.com>.
typo. i'm not in good typing mode today -  i strained something in my  
neck, and have having trouble motivating myself  to work, much less  
perform correctly.

thanks for the note.

On Oct 31, 2005, at 6:18 PM, Philip M. Gollucci wrote:

> I assume this is a typo, but that should be method="POST"
> just to state the obvious.                         ^

Re: POST vs GET

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Jonathan wrote:
>           {form action="" method=POST"}
I assume this is a typo, but that should be method="POST"
just to state the obvious.                         ^


-- 
END
------------------------------------------------------------
     What doesn't kill us can only make us stronger.
                 Nothing is impossible.
				
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
   http://www.liquidityservicesinc.com
        http://www.liquidation.com
        http://www.uksurplus.com
        http://www.govliquidation.com
        http://www.gowholesale.com