From: PartyPosters [mailto:[EMAIL PROTECTED] 

> Hello,
> Please can someone tell me how you pass arrays between PHP pages.
> I have tried something like this and have tried many 
> variations of this but
> nothing working yet ;
> 
> 
> Page 1
> $testArray[0] =Apple;
> $testArray[1] =Banana;
> $testArray[2] =Peach;
> 
> echo "<INPUT NAME = \"kcompany[]\" TYPE = \"hidden\" 
> VALUE=\"$testArray\">";
> 
> Page2
> echo $testArray[1];

This is more of a PHP question, and I'm sure you'll be admonished for
it, but I'll answer it anyway. Essentially, you need to construct the
array elements as their own hidden values.

echo "<INPUT NAME = \"kcompany[]\" TYPE = \"hidden\"
VALUE=\"Apple\">";
echo "<INPUT NAME = \"kcompany[]\" TYPE = \"hidden\"
VALUE=\"Banana\">";
echo "<INPUT NAME = \"kcompany[]\" TYPE = \"hidden\"
VALUE=\"Peach\">";

At that point, if you call:

echo $kcompany[1];

after the form submit, you'll get Banana.

HTH!

-- 
Mike Johnson             Smarter Living, Inc.
Web Developer            www.smartertravel.com
[EMAIL PROTECTED]   (617) 886-5539

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to