Author

Topic: Get the current bitcoin price and the balance of an address in PHP and jQuery. (Read 837 times)

newbie
Activity: 28
Merit: 0
Hi guys! Before we begin, I would say that I will use Blockchain.info here.
Let's begin with the price calculator. It's very simple.

First, create a completely new php file called 'get.php'.
In that file, start your PHP tags normally.

Then create a variable like so:
Code:
$json_response = file_get_contents('http://www.blockchain.info/ticker');
After that, echo it like this:
Code:
echo $json_response;
We will bemaking an Ajax request to this page instead Blockchain.info, because we can only Ajax in our domain.

So here's the code for 'get.php'
Code:
$json_response file_get_contents('http://www.blockchain.info/ticker');
echo 
$json_response;
?>


In your main file's section, include the latest jQuery build.

At the bottom of your tag, open a