[mapserver-users] passing arrays betn. php and javascript (fwd)

Pushkar Pradhan pushkar at ERC.MsState.Edu
Fri Apr 26 15:51:08 EDT 2002


Puneet, Steve Thanks for your responses.
I actually achieved the desired in php itself:
I've a checkbox asking whether the user wants to change the drawing order
of layers,
if it's checked it redirects them to a new page with the chosen layers,
the user plays around with this array (arranging elements) and when they
submit they are redirected to the original page,
then I plan to do setlayers....() etc.
I suppose lot of people must have done this, actually I have to do this
since one of our client wanted to specify his own drawing order?

> you html code looks like so...
>
> <input name="arLayers[]" type="checkbox" value="pistachio" checked>
> <input name="arLayers[]" type="checkbox" value="hazelnuts">
> <input name="arLayers[]" type="checkbox" value="honey" checked>
> <input name="arLayers[]" type="checkbox" value="phyllo">
>
>
> (sorry, I just ate baklava at Husnu's)
>
>
> your php code automatically gets $arLayers with the checked layers as its
> elements that you can loop through.
>
> have fun.
>
> pk/
>
>
>
> > -----Original Message-----
> > From: Pushkar Pradhan [mailto:pushkar at ERC.MsState.Edu]
> > Sent: Friday, April 26, 2002 12:02 PM
> > To: mapserver-users at lists.gis.umn.edu
> > Subject: [mapserver-users] passing arrays betn. php and javascript
> >
> >
> > Hi,
> > In my maps I want to do the foll.:
> > The user should be able to select the layers to display and change the
> > order of the drawing.
> > I think the fastest way is to do this using javascript, since
> > it runs on
> > client side it will be fast.
> > So is it possible to pass an array containing the names of
> > the layers from
> > php to javascript, after changing the element positions in JS
> > have it back
> > in php? Some code snippets would also be appreciated. Thanks,
> >
> > -Pushkar S. Pradhan
> >
>

-Pushkar S. Pradhan





More information about the mapserver-users mailing list