Jump to content

json_encode and jquery


Confidence

Recommended Posts

hi guys,

 

i want to transfer a php array through jquery to another php file as an input paramter, for processing....so i do in  first php file

 

 

$tarif_json=json_encode($tarif_data ['provider']);

 

then i put it in a hidden form field

 

<input type="hidden" name="json" id="json" value="
<?php echo $tarif_json ;?>" >

 

and then i pass it to jquery to pass to another php page:

 

	$('#tarif').load("ajax/order.php?atask=gettarifs", {

		'json' : $('#json').val()
	});

 

but when i debug with firebug in console view, to view ajax processes, i see json is empty under POST.

 

what is the problem here?

and is there another way to send the array to the other php page?

 

thanks in advance.

 

Link to comment
https://forums.phpfreaks.com/topic/193338-json_encode-and-jquery/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.