You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Tomas Eriksson <to...@spray.se> on 2002/02/19 10:47:51 UTC

A really strange POST problem

Hi.

I'm not sure if this a modperl problem but I'm using modperl (5.005), Apache (1.3) under 
Debian on my website. 

Using read(STDIN, $ENV{...}, $buffer) to retrieve the post data. At several places i'm using
forms with radio buttons from -2 to 2, but from some of my visitors I got almost randomly
numbers in the form data xxx=13 xxx=4 etc from the radio buttons. I can read these wrong 
values directly in the $buffer string. This happen often if they post many times but seems 
to be to other visitors also.  

I hope I'm not the only one in the world that has this problem...

kind regards
Tomas

Re: A really strange POST problem

Posted by Thomas Eibner <th...@stderr.net>.
On Tue, Feb 19, 2002 at 10:47:51AM +0100, Tomas Eriksson wrote:
> Hi.
> 
> I'm not sure if this a modperl problem but I'm using modperl (5.005), Apache (1.3) under 
> Debian on my website. 
> 
> Using read(STDIN, $ENV{...}, $buffer) to retrieve the post data. At several places i'm using
> forms with radio buttons from -2 to 2, but from some of my visitors I got almost randomly
> numbers in the form data xxx=13 xxx=4 etc from the radio buttons. I can read these wrong 
> values directly in the $buffer string. This happen often if they post many times but seems 
> to be to other visitors also.  
> 
> I hope I'm not the only one in the world that has this problem...

Please use CGI.pm, Apache::Request, or something else other than rolling
your own solution for reading the CGI data - it will save you time in the
long run.

If it was a bug you'd have to be more specific as to which versions you
are running of Apache/mod_perl.

-- 
  Thomas Eibner <http://thomas.eibner.dk/> DnsZone <http://dnszone.org/>
  mod_pointer <http://stderr.net/mod_pointer> <http://photos.eibner.dk/>

Re: A really strange POST problem

Posted by Oscar Serrano <os...@fondos.net>.
At 10:47 19/02/2002 +0100, Tomas Eriksson wrote: 
>
> Hi.
>  
> I'm not sure if this a modperl problem but I'm using modperl (5.005), Apache
> (1.3) under 
> Debian on my website. 
>  
> Using read(STDIN, $ENV{...}, $buffer) to retrieve the post data. At several
> places i'm using
> forms with radio buttons from -2 to 2, but from some of my visitors I got
> almost randomly
> numbers in the form data xxx=13 xxx=4 etc from the radio buttons. I can read
> these wrong 
> values directly in the $buffer string. This happen often if they post many
> times but seems 
> to be to other visitors also.  
>  



Ummm, not sure, but that seems to be the classical problem of not initialicing
the variables at the beggining of the script. Mod_perl mantains a copy of the
value and each time you submit you add the new value to the existing value.
You
are getting different values each time, depending of the httpd child that
serves the script.
Are you using strict (use strict) at the beggining of the script?

Oscar Serrano.



>
> I hope I'm not the only one in the world that has this problem...
>  
> kind regards
> Tomas