forex.pm forex forum binary options trade - Binance - Сryptocurrency exchanges - Prompting an account name
  • Welcome to forex.pm forex forum binary options trade. Please login or sign up.
 

Prompting an account name

Started by Bitcoin, May 18, 2022, 06:18 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bitcoin

Prompting an account name

I made an account "hello" in bitcoin daemon and wanted to run this. Whenever i put in hello when prompted, getac1 would return empty array; whereas, getac2 and getac3 returns addresses associated with account hello. What am I missing?
Assume I put in proper username, password, ip address, and port.



<?php
require('easybitcoin.php');
$bitcoin = new Bitcoin("username", "password", "ip address", "8332");
//prompt function
function prompt($prompt_msg){
   echo("<script type='text/javascript'> var answer = prompt('".$prompt_msg."'); </script>");
   $answer = "<script type='text/javascript'> document.write(answer); </script>";
   return($answer);
}

//program
$prompt_msg = "Please enter account name";
$name = prompt($prompt_msg);

$getac1 = $bitcoin->getaddressesbyaccount($name);
$getac2 = $bitcoin->getaddressesbyaccount("hello");
$getac3 = $bitcoin->getaddressesbyaccount(hello);

print_r($getac1);
print_r($getac2);
print_r($getac3);
print_r($name);
echo "</pre>";
?>

Source: Prompting an account name