I am trying to send different values to php script using jQuery.post
The data I want to send are links like this
http://example.com/image1.jpg
http://example.com/image2.jpg
http://example.com/image3.jpg
http://example.com/image4.jpg
I don't have an exact amount of these links they would vary depending on the user interacting with my script
I am storing these links in a javascript array "fileLinks".
what I want to do is to send these links to php using jQuery.post
Can I format these links in this shape?
jQuery.post(MyAjax.ajaxurl,
{ action : 'ajax-rform',
link1: http://example.com/image1.jpg,
link2: http://example.com/image2.jpg,
link3: http://example.com/image3.jpg,
link4: http://example.com/image4.jpg,
},
function(data){
jQuery("#fileupload").after('<h1>Success</h1><p>Your registration has been recieved.</p>');
}
);
In php I just need to use for loop and replace the link1 and http://example.com/image1.jpg with the arrays and php would iterate it for me but what should I do in javascript?
Thanks