POSTing an array to a PHP file, correct technique?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

POSTing an array to a PHP file, correct technique?

thefreeman
How do I post a JavaScript array to a PHP file?

This is what I'm attempting at the moment, links is an array. Should this work? I understand that HTML headers cannot contain complex datasets like arrays, so what format is the data sent in? Ie. how do I decompose the array on the PHP end? Or is there a better way entirely of doing this?

Thanks!

$.ajax({
 type: "POST",
 url: "http://asdfasdf.heliohost.org/multiurl.php",
 data: links,
 success: function(response) {
 getURL(response);

 }
 });