Passing a jQuery array to a php array

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Pavilion
Forum Contributor
Posts: 301
Joined: Thu Feb 23, 2012 6:51 am

Passing a jQuery array to a php array

Post 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
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Passing a jQuery array to a php array

Post 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.
Post Reply