Page 1 of 1

Passing a jQuery array to a php array

Posted: Wed May 15, 2013 9:01 pm
by Pavilion
Hello Everyone:

I need to pass a jQuery array to a php array. How do I do this?

The jQuery array is coming back to a main php page from a .getJSON call. Following is my script:

Code: Select all

	$('#historyBttn').click(function(){
	var History_Arry = new Array();
		console.log("inside history click");
		$.getJSON("ol_LogHistory.php", function(data) {
		History_Arry = data;
		console.log(History_Arry);
		});	
	});
I need to pass the History_Array (or data itself) to a php Array so I can process data in the existing main php file.

How can I take the $.getJSON data and pass it to php?

Thanks in advance for the advice.

Pavilion

Re: Passing a jQuery array to a php array

Posted: Wed May 15, 2013 10:23 pm
by requinix
You're getting it from one PHP script, passing it through Javascript, and now want to send it to PHP again? Just make this "main PHP page" get the data right from the start, using whatever mechanism that this ol_LogHistory.php script uses.