RE: [PHP] html form array

From: Date: Sun, 13 Oct 2002 03:00:04 +0000
Subject: RE: [PHP] html form array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-119765@lists.php.net to get a copy of this message
> dear all, > i ran my code below on ie and it works. but when i use netscape 4.76 under > linux, i only get the > message "submitted" even though i've checked some fields. The code is running on the same box, right? Just accessing it with different browsers? > what do i need to add to make it work with netscape under linux? > code follows: > > <? > if ($_POST["submit"]) { > print "submitted<BR>"; > for($i=0;$i<sizeof($foo);$i++) { > print "$foo[$i]<BR>"; > } > } > else { > ?> > <form action=<? echo $_SERVER["PHP_SELF"] ?> method=post> > <input type=checkbox name=foo[] value=one>One > <input type=checkbox name=foo[] value=two>Two > <input type=checkbox name=foo[] value=three>Three > <input type=submit value=submit name=submit> > </form> Try putting quotes (") around your types, names, and values in your input elements. Netscape may not recognize foo[] as a proper name without the quotes and send the data incorrectly. ---John Holmes...

« previous php.general (#119765) next »