Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6692623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:53:20+00:00 2026-05-26T05:53:20+00:00

I have a script to send friend request by Request Dialog function requestCallback(response) {

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:53:20+00:00Added an answer on May 26, 2026 at 5:53 am

    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.

    function requestCallback(response)
    {
        if(response && response.request)
        {
            console.log(response);
            location.href='step2.php?ids='+response.to.join(",");
        }
        else
        {   
            location.href='step1.php';
        }
    }
    

    And then in your php file step2.php, you can get those user ids in this way

    <?php
    $userids = explode(",",$_GET['ids']);
    ?>
    

    Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script which tracks visits & referers to a website. I send
I have some troubles with encoding and mailing. I send post-request to php-script, when
I have following code in a python script try: # send the query request
I have a script that uses PHP mail() function to send emails: mail(me@mydomain.com, Subject,
I have jquery script, which should send response to my file. If everything good,
I want to have a PHP script send a XML formatted string to another
I have a script set up to send out multipart emails; plain text and
I have a bash script that uses growlnotify to send notifications. However, growlnotify doesn't
I have an existing Perl script that uses the FTP object to send a
I have a simple Python script that uses the socket module to send a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.