Re: textarea posting duplicate text

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Elizabeth Lawrence wrote:
> Hello. I have been asked to look at a PHP issue for someone, and I can't
> figure out what the problem is. I'm hoping one of you experts can help!
>
> They are using Red Hat Linux / Ensim Pro 4.0.2, PHP 4.3.10, and Apache
> 2.0.
>
> The problem: When a lot of text is entered into a textarea on a form, the
> text that shows up in the $_POST['textarea'] variable has the text that
> was
> entered, but it is duplicated.

Have you verified that the POST data itself is doubled?...

This sounds REALLY weird to me...

> This is causing problems for their forums.
> Here is a very simple script I placed on the server:
> www.tidefans.com/textarea_test.php (code below)
>
> When I place the same script on another server I have access to, the
> textarea text is "posted" fine.
>
> Is this a PHP setting somewhere that I'm missing?

There's certainly on "double long POST data" setting :-)

It could be a bug in PHP or Apache -- Search their bug databases.
http://bugs.php.net/ for PHP.
http://apache.org/ should lead you to it for Apache.
You're on your own for Ensim Pro, whatever that is.

I would also recommend that you start LOGGING the text inputs that are
giving problems as they come in.

EG:
<?php
  $input = $_POST['input'];
  $len = strlen($input);
  if ($len > 10 && substr($input, 0, $len/2) == substr($input, $len/2)){
    error_log("Double Input: $input");
  }
?>

This may lead you to finding some commonality in the input text other than
length that is not immediately apparent right now.

Actually, I guess you *COULD* just use the code above or similar to
automatically strip out the doubled text -- But document/comment the hell
out of that unless you want to confuse every developer that ever looks at
it!!!

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux