Author

Topic: Bitcoin Price Widget Where I was wrong? (Read 203 times)

newbie
Activity: 9
Merit: 0
October 18, 2017, 02:04:25 AM
#1
https://ibb.co/fnUOD6

data.php
Code:

$url 
"https://www.bitstamp.net/api/ticker/";
$fgc file_get_contents($url);
$json json_decode($fgctrue);

$price $json["last"];
$price number_format($price2);
$high $json["high"];
$low $json["low"];
$date date("m-d-Y - h:i:sa");
$open $json["open"];

if(
$open $price){
//price went up
$indicator "+";
$change $price $open;
$percent $change $open;
$percent $percent 100;
$percentChange $indicator.number_format(percent2);
$color "green";
}
if(
$open $price){
//price went down
$indicator "-";
$change $open $price;
$percent $change $open;
$percent $percent 100;
$percentChange $indicator.number_format(percent2);
$color "red";
}

$table = <<

$
$price
$color;">$percentChange%


$
$high


$
$low


$date


EOT;

echo 
$table;
?>

price.html
Code:



Price Widget









Where I was wrong?
thank you
Jump to: