A possible bug in php .3.10 ?

nandyal_at_gmail.com
Date: 03/29/05


Date: 29 Mar 2005 12:04:51 -0800

All,

The following script works as intended in MS-Windows and in other Linux
boxes, except on the one that runs php 4.3.10.
Sorry for the long post.

1) # uname -a
Linux bubba 2.4.20 #5 SMP Thu Apr 3 12:26:19 BST 2003 i686 i686 i386
GNU/Linux

2) #php -v
PHP 4.3.10 (cgi) (built: Mar 15 2005 14:36:32)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

3) Here is the script :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Test form posting arrays - dynamic indexes</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"
/>
</head>
<body>

<form name="test" method="post" action="/status/test.php">
<input type="text" name="test_text[]"><br />
<input type="text" name="test_text[]"><br />
<input type="submit" name="submit" value="Submit">

</form>
</body>
</html>

4) What this script is supposed to do - Show two fields on a web
browser.
But only on this specific server, it shows two fields, and if I input
data it shows me an extra data field !!. As you can see below, I used
the "View Page source" :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Test form posting arrays - dynamic indexes</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"
/>
</head>
<body>
Array
(
    [test_text] => Array
        (
            [0] => test
            [1] => this
            [2] => this <-- This is the error. Why is a third
array
                                    showing up?
        )

    [submit] => Submit
)

<form name="test" method="post" action="/status/test.php">
<input type="text" name="test_text[]"><br />
<input type="text" name="test_text[]"><br />
<input type="submit" name="submit" value="Submit">

</form>
</body>
</html>



Relevant Pages

  • Re: [PHP] PHP console script vs C/C++/C#
    ... My script is taking a longer time to execute than I want. ... I prefer to write in PHP because that is what I know best. ... This is why I am thinking about rewriting my whole script in a C language. ... Perhaps there are different methods I could be using to speed up execution. ...
    (php.general)
  • Re: How to Add a Feeback Form
    ... I saw nothing in that script that indicates where the form is e-mailed to so ... Greg Maxey/Word MVP ... PHP or not. ... have the support available yet. ...
    (microsoft.public.frontpage.programming)
  • How best to show PHP source? (was: One page, multiple submit buttons)
    ... script to add to the top of a PHP script to enable showing its ... Maybe anybody submitting their own PHP code for critique here ... Anything posted to a newsgroup is a "snapshot" of what the ... there ought to be a FAQ for this ...
    (comp.lang.php)
  • Re: [PHP] PHP console script vs C/C++/C#
    ... My script is taking a longer time to execute than I want. ... I prefer to write in PHP because that is what I know best. ... thinking about rewriting my whole script in a C language. ... execution of the code. ...
    (php.general)
  • Email form script
    ... I have a web form that posts to a .php ... who cannot run .php on their server. ... Or does anyone have a .asp script that will ... Thank you for choosing FormToEmail by FormToEmail.com ...
    (microsoft.public.scripting.jscript)