Array and $_POST value's HELP!

From: Date: Tue, 10 Jun 2003 19:25:21 +0000
Subject: Array and $_POST value's HELP!
Groups: php.general 
Request: Send a blank email to php-general+get-150957@lists.php.net to get a copy of this message
Hello everyone, I've got the following problem: I've got two fields called test1[] and test2[]. The value's are stored in an array. For the test1 i can read the array and print the list of value's after the submit. But question is: if(is_array($_POST['test1'])) { foreach($_POST['test1'] as $Key => $Value) { echo $Value; }; How can I put $_POST['test2'] in this piece of code? So that it's both handling Test1 and Test2! Thanks for your help; Here is the full code: <? $_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:""; if($_REQUEST['submit']!="") { if(is_array($_POST['test1'])) { foreach($_POST['test1'] as $Key => $Value) { echo $Value; }; } else { echo $_POST[voorletters]; } } ?> <form name="form1" method=post id=form1 enctype=multipart/form-data action="<? $_SERVER['PHP_SELF']?>"> <? for ($i=1; $i<=4; $i++) { echo "# $i<input type=\"text\" name=\"test1[]\"><br>"; echo "# $i<input type=\"text\" name=\"test2[]\"><br>"; } ?> <input type=submit name=submit value=submit> </form> Thanks in advance for your time and help Regards, Frank

« previous php.general (#150957) next »