For Programmers: Free Programming Magazines  


Home > Archive > PHP on Windows > November 2004 > RE: [PHP-WIN] Re: Passing an Array in HTML









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PHP-WIN] Re: Passing an Array in HTML
Warren Vail

2004-11-22, 8:56 pm

Only real array I've ever seen in HTML is one passed to JavaScript. Anyone
else found another way?

I suppose you could do it as a pull down list (preselecting all selections),
but risk is your user will screw up the data by clicking on the list, but
that struck me as kind of hokey (a technical term if the highest order ;-).

Warren Vail


> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of MikeA
> Sent: Monday, November 22, 2004 4:08 PM
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] Re: Passing an Array in HTML
>
>
> So the only way to do it is by separating all of the elements
> instead of sending it as one big array? Hmmm. There is no
> better way to pass an array?
>
> Thanks.
>
> Mike
>
>
> "Vail, Warren" <Warren.Vail@schwab.com> wrote in message
> news:72138202E59CD6118E960002A52CD9D2178
E2BF6@n1025smx.nt.schw
> ab.com...
> not a good
> some
> on
> information
> stateless, so I need
> way that I
> it is just
> in. But,
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Michael Adams

2004-11-23, 8:56 am

On Mon, 22 Nov 2004 16:12:37 -0800
"Vail, Warren" <Warren.Vail@schwab.com> wrote:

> Only real array I've ever seen in HTML is one passed to JavaScript.
> Anyone else found another way?
>
> I suppose you could do it as a pull down list (preselecting all
> selections), but risk is your user will screw up the data by clicking
> on the list, but that struck me as kind of hokey (a technical term if
> the highest order ;-).
>
> Warren Vail
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


If you set it up properly it can be echoed into the header as
a javascript array and acted on from there.

Compare -
var foo = new Array(
new Array("data1","data2","data3"),
new Array("data4","data5","data6"),
new Array("data7","data8","data9")
);
bar = foo[2][1];

With -
var foo = new Array(
<?php fm happens here which gets sent as identical to the above?>
);
bar = foo[2][1];

Michael Adams
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com