You are here: Sending arrays from page to page « PHP « IT news, forums, messages
Sending arrays from page to page

Posted by "Ben Miller" on 11/15/05 19:07

I am trying to learn how to work with arrays, and have the basic concept
down for working within a single page, but I am having trouble sending an
array from one page to another. For example, I can send a variable from
page to page using either the URL, such as www.domain.com/?foo=bar, or using
a form, but can I send an array from one page to another using a form so
that all the values in the array will be sent? Such as:

Page 1:
----------------------------------------------------------
echo "
<FORM METHOD=POST ACTION=ProcessArray.php>
<INPUT TYPE=TEXT NAME=$TestVariable[1] VALUE=><BR>
<INPUT TYPE=TEXT NAME=$TestVariable[2] VALUE=><BR>
<INPUT TYPE=TEXT NAME=$TestVariable[3] VALUE=><BR>
<INPUT TYPE=SUBMIT VALUE=SUBMIT>
</FORM>
";


Page 2: (ProcessArray.php)
----------------------------------------------------------
for ($i=1;$i<=3;$i++) {
echo "
$TestVariable[$i]<BR>
";
}

Any help would be greatly appreciated. Thanks in advance.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация