Author

Topic: Block.io api error line 112 (Read 1431 times)

full member
Activity: 280
Merit: 101
Proof-of-Stake Blockchain Network
February 02, 2015, 05:48:19 PM
#5
What happened to your original code?  Previously you had "BlockIo->__call" based on the code I've seen so far BlockIo isn't a valid command. Maybe try "$block_io->__call"  etc

I'm not entirely familiar with block.io but it looks like it puts the address in an assoc array. Does it work when you try print it out?

Code:
echo $newAddressInfo['shibe1']; 
thx for your helps. i solve. i just forget add SSL certificate to php.ini.
legendary
Activity: 1442
Merit: 1186
February 02, 2015, 04:47:05 PM
#4
What happened to your original code?  Previously you had "BlockIo->__call" based on the code I've seen so far BlockIo isn't a valid command. Maybe try "$block_io->__call"  etc

I'm not entirely familiar with block.io but it looks like it puts the address in an assoc array. Does it work when you try print it out?

Code:
echo $newAddressInfo['shibe1']; 
full member
Activity: 280
Merit: 101
Proof-of-Stake Blockchain Network
February 02, 2015, 02:32:23 PM
#3
Did you set up your initialize section properly in game.php?

Code:
 $block_io = new BlockIo($apiKey, $pin, $version);

The sample php for generating a new address is a bit different than the way you are trying to do it.

Code:
 $newAddressInfo = $block_io->get_new_address(array('label' => 'shibe1'));
Code:
require_once 'block_io.php';

$apiKey = "my api";
$version = 2; // API version
$pin = "my secret pin";
$block_io = new BlockIo($apiKey, $pin, $version);
$newAddressInfo = $block_io->get_new_address(array('label' => 'shibe1'));

my php file
legendary
Activity: 1442
Merit: 1186
February 02, 2015, 01:32:03 PM
#2
Did you set up your initialize section properly in game.php?

Code:
 $block_io = new BlockIo($apiKey, $pin, $version);

The sample php for generating a new address is a bit different than the way you are trying to do it.

Code:
 $newAddressInfo = $block_io->get_new_address(array('label' => 'shibe1'));
full member
Activity: 280
Merit: 101
Proof-of-Stake Blockchain Network
February 02, 2015, 12:48:05 PM
#1

Notice: Trying to get property of non-object in C:\xampp\htdocs\block_io.php on line 112

Notice: Trying to get property of non-object in C:\xampp\htdocs\block_io.php on line 112

Notice: Trying to get property of non-object in C:\xampp\htdocs\block_io.php on line 112

Fatal error: Uncaught exception 'Exception' with message 'Failed: ' in C:\xampp\htdocs\block_io.php:112 Stack trace: #0 C:\xampp\htdocs\block_io.php(65): BlockIo->_request('get_new_address', Array) #1 C:\xampp\htdocs\game.php(12): BlockIo->__call('get_new_address', Array) #2 C:\xampp\htdocs\game.php(12): BlockIo->get_new_address(Array) #3 {main} thrown in C:\xampp\htdocs\block_io.php on line 112


how can i solve this?
Jump to: