I have a script to send friend request by Request Dialog
function requestCallback(response)
{
if(response && response.request)
{
console.log(response);
location.href='step2.php';
}
else
{
location.href='step1.php';
}
}
The console.log(response) outputs in Firefox’s console :
({request:THIS_IS_REQUEST_ID, to:[REQUESTED_USER_ID_1, REQUESTED_USER_ID_2, REQUESTED_USER_ID_ETC...]})
How I can convert the variable console.log(response); to PHP variable?
Because I need the values like REQUESTED_USER_ID_1, REQUESTED_USER_ID_2 JSON output from the console.log(response); to be parsed by PHP’s json_decode, like this.
Thanks!
You cannot actually convert them into PHP variable, but what you can do is that you can send the REQUESTED_USER_ID1…IDn to the php file that you are setting as location.href as a HTTP GET parameter in this way.
And then in your php file step2.php, you can get those user ids in this way
Hope it helps.