You are here: Re: how to pass the javascript array value to for the php variable. « PHP Programming Language « IT news, forums, messages
Re: how to pass the javascript array value to for the php variable.

Posted by Ron Barnett on 09/11/07 08:31

"IRC" <ircadhikari@gmail.com> wrote in message
news:1189488646.751184.158810@19g2000hsx.googlegroups.com...
> hey, i am pretty new on javascript as well as PHP,
>
> Hey, anyone can you help me, how to pass the javascript array value to
> php page.........
> i want to retrieve the values which are arrayed on "selectedValues"
> from next page for php variable
>
> this is my javascript code saved on "sendValue.js" file,
> <script>
> function updateRecordEntry(requestValue){
> var slen= requestValue.length;
> var selectedValues = new Array();
> var selCount="";
> for(var i=slen-1; i>=0; i--){
> if(requestValue.options[i].selected){
> selectedValues[selCount] =
> requestValue.options[i].value;
> selCount++;
> }
> }
> }
> </script>
>
> i need to retrieve the array "selectedValues" values from next php
> pages. so, how i can do this..........
> i am previously doing through url to pass single javascript value and
> do $_REQUEST from next php page. But here i need to send/retrieve the
> array not the single value.
> so which is the better way for this.............
>
> Thank You

you can assign the array to a hidden input variable in an html form and
either use a submit button or JavaScript to fire the submit event and pass
it using a post rather than a get.
Collect the array from $_REQUEST .

Cheers

Ron

 

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

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