Re: looking for newbie help in solving logic problem
| From: | Jason Wong | Date: | Wed, 23 Jan 2002 19:32:26 +0000 |
| Subject: | Re: looking for newbie help in solving logic problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81745@lists.php.net to get a copy of this message | ||
On Saturday 19 January 2002 12:24, Larry Brown wrote:
> 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");
> }
I think get rid of this 'problem' by using arrays. As in:
echo '<input type="text" size=3 name="connlt[', $i, ']"
value=";, ...
resulting in the HTML:
<input type="text" size=3 name="connlt[0]" value="whatever">
etc