Commit 20af6c34 authored by Gampe Sebastian's avatar Gampe Sebastian
Browse files

change env var names

parent 10e30094
Pipeline #21142 passed with stage
in 16 seconds
<? <?
ini_set('display_errors', 1); ini_set('display_errors', 1);
ini_set('display_startup_errors', 1); ini_set('display_startup_errors', 1);
error_reporting(E_ALL); error_reporting(E_ALL);
$RPCusername = $_ENV['rpcuser']; $RPCusername = $_ENV['erpcuser'];
$RPCpassword = $_ENV['rpcpassword']; $RPCpassword = $_ENV['erpcpassword'];
$RPCconnect = $_ENV['rpcconnect']; $RPCconnect = '127.0.0.1';
$RPCport = $_ENV['rpcport']; $RPCport = $_ENV['erpcport'];
$faircoinAddress = $_GET['address']; $faircoinAddress = $_GET['address'];
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, $RPCusername.':'.$RPCpassword); curl_setopt($ch, CURLOPT_USERPWD, $RPCusername.':'.$RPCpassword);
curl_setopt($ch, CURLOPT_URL, $RPCconnect.':'.$RPCport); curl_setopt($ch, CURLOPT_URL, $RPCconnect.':'.$RPCport);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"id":"curltext","method":"getaddressbalance","params":{"address":"'.$faircoinAddress.'"}}'); curl_setopt($ch, CURLOPT_POSTFIELDS, '{"id":"curltext","method":"getaddressbalance","params":{"address":"'.$faircoinAddress.'"}}');
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
$headers = array(); $headers = array();
$headers[] = "Content-Type: application/x-www-form-urlencoded"; $headers[] = "Content-Type: application/x-www-form-urlencoded";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch); $result = curl_exec($ch);
if (curl_errno($ch)) if (curl_errno($ch))
{ {
echo 'Error:'.curl_error($ch).PHP_EOL; echo 'Error:'.curl_error($ch).PHP_EOL;
} }
else else
{ {
$result =json_decode($result,true); $result =json_decode($result,true);
echo json_encode($result['result']); echo json_encode($result['result']);
//echo($result['result']['confirmed'].PHP_EOL); //echo($result['result']['confirmed'].PHP_EOL);
//echo($result['result']['unconfirmed'].PHP_EOL); //echo($result['result']['unconfirmed'].PHP_EOL);
} }
curl_close ($ch); curl_close ($ch);
exit(); exit();
?> ?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment