Bitcoin Forum
May 27, 2024, 11:01:17 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Displaying my coin balance on a website using PHP  (Read 54 times)
The_Trader (OP)
Member
**
Offline Offline

Activity: 180
Merit: 52


View Profile
May 15, 2021, 09:53:53 AM
 #1

Hi so its been a while since I needed to do this and it looks like my coding knowledge is well behind.

So I have a dedicated server with several wallets running on, and I want to display my coin balance amongst other things on a webpage (PHP)

In the past I would have created  a config file with :
rpcuser=
rpcpassword=
And simply connected with the daemon to fetch the info I required, however I have just tried this with colossusxt and my terminal has thrown this out at me:
Error: There is no RPC client functionality in colxd anymore. Use the colx-cli utility instead.

Could some one explain what the cli utility is or even better does anyone have an example bit of code used for pulling the info from the deamon and displaying on a web page?

Many Thanks
TT
NotATether
Legendary
*
Offline Offline

Activity: 1610
Merit: 6763


bitcoincleanup.com / bitmixlist.org


View Profile WWW
May 15, 2021, 10:55:58 AM
 #2

Given that colussusxt is an altcoin you will have a better chance of getting an answer if you move this to the altcoins board.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
The_Trader (OP)
Member
**
Offline Offline

Activity: 180
Merit: 52


View Profile
May 16, 2021, 11:05:30 AM
 #3

Hi I am also trying to display my bitcoin balance.

I have found some examples like this:

Code:
  require_once 'jsonRPCClient.php';
  
  $bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/');
  
  echo "<pre>\n";
  print_r($bitcoin->getblockchaininfo());
  echo "</pre>";

But the output of that is blank page, the IP is changed to my dedicated server and the port number is apparently the default one so i left as it is but I have no clue if that is right but in any event should it not at least throw out an error?

Thanks
TT
NotATether
Legendary
*
Offline Offline

Activity: 1610
Merit: 6763


bitcoincleanup.com / bitmixlist.org


View Profile WWW
May 16, 2021, 06:02:00 PM
 #4

Try setting up a web server with CGI or FPM and placing that PHP in a server-side script, then from your HTML call the PHP script with no arguments.

I don't think it's going to work if you place the PHP directly in the HTML because you can't require anything from it.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!