Possible Duplicate:
Passing jquery variable with json
I am trying to pass a jquery variable from a view to my controller using this code
var str = 'Some data i need';
$.post('Configs/', {data : str});
and then I am retrieving it in my controller with this code.
if($this->request->is('post'))
{
$value = $_POST['data'];
if($value == null)
{
$this->Session->setFlash('null');
}
else
{
foreach($value as $v)
{
$this->Session->setFlash($v);
}
}
}
I can retrieve the array but when I try to iterate through $value all it prints out is the word 'Array'.
thanks for any help in advance.