looking for newbie help in solving logic problem
| From: | Larry Brown | Date: | Sat, 19 Jan 2002 04:24:00 +0000 |
| Subject: | looking for newbie help in solving logic problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-81736@lists.php.net to get a copy of this message | ||
The following is an over simplified description. With additional items not
included everything here works except for the last string. (hence the
problem)
_
#page 1
#pull info from several similar sections from a file stored in $array
----------------------------------------------------------------------------
-----
$top = count($array); //number of times needed to read info from file.
for ($i=0; $i<$top; $i++)
{
echo '<input type="text" size=3 name="connlt', "$i",
'" value=";,
"$InfoFromExistingFile", '">';
echo '<input type="hidden" name="conncycle" value="',
$numbconn", '">';
}
#page 2
#take variables $connlt0, $connlt1, and $connlt2 and place them in a file
for ($i=0;$i<$limit;$i++)
{
fwrite($fw, "bla bla-$connlt[$i] bla bla bla");
}
----------------------------------------------------------------------------
----
The string I'm attempting to send to the file should be the contents of
$connlt0 on the first pass $connlt1 on the second, and so on. What I get as
you experienced progammers probably already recognize is $connlt which has a
value of "0" followed by [0] on the first pass and [1] on the second etc. I
tried concatination "$connlt"."[$i]" which resolves to "0" and
"$"."connlt"."[$i]" which sends the actual string bla bla-$connlt1 bla
bla
bla". Can someone help show how to get the string after concatenation to
take on the value carried over from the first page? I've verified using
echo the contents of $connlt0 to be in existence.
Thank you in advance,
Larry