Bug #18444 Updated: arrays sent by html form, the count is duplicate

From: Date: Sun, 21 Jul 2002 05:22:55 +0000
Subject: Bug #18444 Updated: arrays sent by html form, the count is duplicate
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14718@lists.php.net to get a copy of this message
ID: 18444 Updated by: youngga@hotmail.com Reported By: youngga@hotmail.com Status: Bogus Bug Type: Arrays related Operating System: linux PHP Version: 4.2.1 New Comment: Thanks your comment. But I set register_glovals On already. My test page is www.ftpmail.com/test/test_array.php , please try and check it. The page source is following. --------------------------------------------------- <html> <head> <title>test_array</title> </head> <body> <table align="center" border="0"> <tr> <td> <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> </select> <input type="submit" name="sub1" value="submit"> </form> <?php if(!empty($HTTP_POST_VARS["test_val"])) { $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>&nbsp;</p> <p><a href="menu.htm">go to menu</a></p> </td> </tr></table> </body> </html> --------------------------------------------------------- You can see my homepage's phpinfo() at www.ftpmail.com/test.php I am looking forward your answer. Previous Comments: ------------------------------------------------------------------------ [2002-07-20 12:22:11] sniper@php.net In PHP 4.2.0, the 'register_globals' setting default changed to be off. See http://www.php.net/release_4_2_0.php 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-19 23:24:37] youngga@hotmail.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> </select> //My source at server page... count(my_val); // the count value is different from I selected. So I have tested on PHP4.1.2 then no troubles. What is the problem ? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18444&edit=1

« previous php.bugs (#14718) next »