Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

How to pass js array to php file

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

How to pass js array to php file

Postby mayur288 » Sun Feb 24, 2013 3:43 am

i don't know how to pass js array to php file using ajax?

my array is :

var arr= new Array();

with suppose these values : id, price, quantity like

this is my js code on submit :

Code: Select all
         type : 'GET',
         url : 'code/GetData.class.php',
         data : {arr : arrItemsList},
         cache : false,
         success : function(data) {
               return true; //will navigate to next page
               return false; // on data false nothing will happen

Tell me if there is any thing wrong in js.

now want to know how do I acceess arr in php code

GetData.class.php file code :

Code: Select all
/*................code for accessing array variable arr.........*/

thanks in advance
New php-forum User
New php-forum User
Posts: 2
Joined: Sun Feb 24, 2013 3:00 am

Return to PHP coding => General

Who is online

Users browsing this forum: Google Feedfetcher and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.