|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18444 arrays sent by html form, the count is duplicate
Submitted: 2002-07-19 23:24 UTC Modified: 2002-07-22 20:32 UTC
From: youngga at hotmail dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.2.1 OS: linux
Private report: No CVE-ID: None
 [2002-07-19 23:24 UTC] youngga at hotmail dot com
sorry, my english.

When I send array with http form, the count of array is duplicate at server page.

//My source at http form.....
<select name='my_val[]' size='3' onfocus='set_check()' multiple>
										<option value=' 1'>val1</option>
										<option value=' 2'>val2</option>
										<option value=' 3'>val3</option>
//My source at server page...

the count value is different from I selected.

So I have tested on PHP4.1.2 then no troubles.

What is the problem ? 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-20 12:22 UTC]
In PHP 4.2.0, the 'register_globals' setting default changed to
be off. See for more info.
We are sorry about the inconvenience, but this change was a necessary
part of our efforts to make PHP scripting more secure and portable.
 [2002-07-21 01:22 UTC] youngga at hotmail dot com
Thanks your comment.
But I set register_glovals On already.
My test page is , please try and check it.
The page source is following.


<table align="center" border="0">
<p>Array form tranasfer test page.

<p>Select value then click submit.</p>

			<p>Use shift or crtl key for multi select.</p>
<form name="files_up" action="<? echo $PHP_SELF; ?>" method="post">
	<select name='test_val[]' size='5' multiple>
	<option value='val1'>val1</option>
	<option value='val2'>val2</option>
	<option value='val3'>val3</option>
	<option value='val4'>val4</option>
	<option value='val5'>val5</option>
 <input type="submit" name="sub1" value="submit"> 

		$nums = count($HTTP_POST_VARS["test_val"]);
		echo "no of count = ".$nums."<br><br>";
		for($i=0; $i < $nums; $i++)
		echo "<br>test_val[".$i."] = ".$HTTP_POST_VARS["test_val"][$i];
<p><a href="menu.htm">go to menu</a></p>
You can see my homepage's phpinfo() at 
I am looking forward your answer.
 [2002-07-22 20:32 UTC] youngga at hotmail dot com
I changed aparch version from 2.0.39 to 1.3.26 and the problem was disappeared.
But I doubt PHP is well operating.
Above test url is not avaible from now.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Dec 06 20:03:41 2022 UTC