NYCPHP Meetup

[nycphp-talk] how to pass the dynamic array indexes from one f orm to another in PHP 4.2

Nunez, Eddy enunez at tiaa-cref.org
Tue Mar 4 17:07:03 EST 2003


Would help if you can tell us what you're trying to do in dynamic2.
If you're trying to just loop through the children:

<html>
<body>
<? $counter=1;
   foreach ( $Child as $c ) {
	echo "Child #". $counter++ ." is $c <br>";
   }
?>
</body></html>

-Ed

-----Original Message-----
From: LS [mailto:lss1 at netzero.net]
Sent: Tuesday, March 04, 2003 4:16 PM
To: NYPHP Talk
Subject: [nycphp-talk] how to pass the dynamic array indexes from one
form to another in PHP 4.2


hi;
I have a problem.I don't know what to write in my program dynamic2.php. The
program dynamic.php passes array to program dynamic2.php. What code should
be written in dynamic2.php ?
thnks
Leo
attached codes for both programs

code for dynamic.php:
<HTML>
<HEAD></HEAD>
<BODY>
<FORM METHOD=GET ACTION="dynamic2.php">
<?php
for ($Counter=0; $Counter<$_POST['Number']; $Counter++)
{
   $Offset = $Counter+1;
   echo "<BR><BR>Please enter the name of child number $Offset<BR>";
   echo "<INPUT NAME=Child[] TYPE=TEXT>";
}
if ($Counter==0) echo"Press the button to move on";
?>
<BR>
<BR>
<INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>

--code for dynamic2.php:
<HTML>
<HEAD></HEAD>
<BODY>
<?php
$Count=0;
echo "yoe children names are :";
do
; $Counter++)
{
      echo "<BR><BR>$_GET['Number']";//?
   echo "<INPUT NAME=Child[] TYPE=TEXT>";
}
if ($Counter==0) echo"Press the button to move on";
?>
<BR>
<BR>
<INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>




--- Unsubscribe at http://nyphp.org/list/ ---



**********************************************************************
This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is protected by law.  If you are not the intended recipient, please contact sender immediately by reply e-mail and destroy all copies.  You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.
TIAA-CREF
**********************************************************************



More information about the talk mailing list