"kingofkolt" wrote:[color=blue]
> "Westcoast Sheri" <sheri_deb88@nospamun8nospam.com> wrote in
> message
> news:41368F21.4E9BDACB@nospamun8nospam.com...[color=green]
> > Can I use a form to post an array? If so, why doesn’t my[/color]
> example work[color=green]
> >
> > note that register globals is on....
> >
> > <form method="post" action="page2.php">
> > <?php
> > $allVariablesFromPreviousPage = $_POST;
> > echo ’<input type="hidden"[/color]
> value="’,$allVariablesFromPreviousPage,’">’;[color=green]
> > ?>
> > </form>
> >
> > ...page2.php should now have all the $_POST variables from my[/color]
> page1.php[color=green]
> > in the new variable "$allVariablesFromPreviousPage"...but it[/color]
> doesn’t.[color=green]
> >[/color]
>
> You could try:
>
> foreach ( $_POST as $postitem ) {
> echo ’<input type="hidden" name="postitem[]"
> value="’ . $postitem .
> ’">’;
> }
>
> Then access the vars from the previous page with
> $_POST[’postitem’][’someitem’].
>
> - JP[/color]
another approach is to serialize your array, then do a rawurlencode.
Then post it. To retrieve, do a rawurldecode and then unserialize.
--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL:
http://www.dbForumz.com/PHP-array-po...ict145660.html
Visit Topic URL to contact author (reg. req'd). Report abuse:
http://www.dbForumz.com/eform.php?p=487580