Author

Topic: My code is wrong and I cant figure it out :-\ (Read 141 times)

legendary
Activity: 1596
Merit: 1288
It's throwing an error I have never seem before:

Code:
[07-Mar-2022 21:11:03 UTC] PHP Fatal error:  Uncaught Exception: Incorrect response id (request id: 1646687463, response id: )
PHP Fatal error is because of JSON-RPC.

you need to enable JSON-RPC check your Global Settings from tab 'Services'
you also need to setup your config like:


Code:
server=1
rpcallowip=127.0.0.1
daemon=1

check also if you whitelist your IP

member
Activity: 180
Merit: 52
I would try this:
Code:
  require_once 'jsonRPCClient.php';
 
  $bitcoin = new jsonRPCClient('http://xxxxxxxx:[email protected]:27772/');
  echo print_r($bitcoin);
  echo "
\n";
  echo print_r($bitcoin->getbalance());
  echo "
";

than look at the source of the page rendered.

print_r itself represent a string. You must echo it to print it.

If it appears that "bitcoin" is NULL or some error object, it may not be connecting. The info there you would get there may give you some insight.

You may also consider looking into:
Code:
ini_set('display_errors', 1);
error_reporting(E_ALL);

It's throwing an error I have never seem before:

Code:
[07-Mar-2022 21:11:03 UTC] PHP Fatal error:  Uncaught Exception: Incorrect response id (request id: 1646687463, response id: )
newbie
Activity: 22
Merit: 67
I would try this:
Code:
  require_once 'jsonRPCClient.php';
 
  $bitcoin = new jsonRPCClient('http://xxxxxxxx:[email protected]:27772/');
  echo print_r($bitcoin);
  echo "
\n";
  echo print_r($bitcoin->getbalance());
  echo "
";

than look at the source of the page rendered.

print_r itself represent a string. You must echo it to print it.

If it appears that "bitcoin" is NULL or some error object, it may not be connecting. The info there you would get there may give you some insight.

You may also consider looking into:
Code:
ini_set('display_errors', 1);
error_reporting(E_ALL);
member
Activity: 180
Merit: 52


I am trying to display information from my vps wallet onto my php webpage, I have spent 2 days googling but to no avail, perhaps some one here could laugh at my code and correct it - or - suggest a better way to achieve what I am looking for.


   
Code:
 require_once 'jsonRPCClient.php';
  
  $bitcoin = new jsonRPCClient('http://xxxxxxxx:[email protected]:27772/');
  
  echo "
\n";
  print_r($bitcoin->getbalance());
  echo "
";


The result of the above is a white page, and on view source it displays

Code:

Many thanks
Jump to: