Esempio n. 1
0
     //GetAddress("http://maps.google.cn/maps/api/geocode/json?latlng=".$Latitude.",".$Longitude."&sensor=true");;
     AddNewMessage($DB, $Note, $SendAccount, $Latitude, $Longitude, $Altitude, $AddressZH, $AddressEN);
     echo "{'state':'1003','message':'SendMessageSucceed'}";
     break;
 case 'gsm':
     $cellId = $_POST['cid'];
     $locationAreaCode = $_POST['lac'];
     $mobileCountryCode = $_POST['mcc'];
     $mobileNetworkCode = $_POST['mnc'];
     $imei = $_POST['imei'];
     $jsonString = FromGSMGetAddress($cellId, $locationAreaCode, $mobileCountryCode, $mobileNetworkCode);
     $arr = json_decode($jsonString, true);
     $latitude = empty($arr["location"]["latitude"]) ? 0.0 : $arr["location"]["latitude"];
     $longitude = empty($arr["location"]["longitude"]) ? 0.0 : $arr["location"]["longitude"];
     echo "{'state':'1002','message':'{$latitude},{$longitude}'}";
     $address = GetAddress("http://maps.google.com/maps/api/geocode/json?latlng=" . $latitude . "," . $longitude . "&sensor=true");
     GsmLog($DB, $cellId, $locationAreaCode, $mobileCountryCode, $mobileNetworkCode, $imei, $latitude, $longitude, $address);
     break;
 case 'reg':
     $email = $_POST['email'];
     $nick = $_POST['nick'];
     $pass = $_POST['pass'];
     $imei = $_POST['imei'];
     break;
 case 'getLocalMessage':
     $Latitude = $_POST['Latitude'];
     $Longitude = $_POST['Longitude'];
     $localMessage = GetNearbyMessage($DB, $Latitude, $Longitude);
     echo "{'state':'1006','message':'{$localMessage}'}";
     break;
 case 'getuser':
Esempio n. 2
0
$rpcpass = "";
// rpc pass
$rpcip = "localhost";
// rpc host
$rpcport = 9333;
// rpc daemon port
$blackcoind = new jsonRPCClient("http://{$rpcuser}:{$rpcpass}@{$rpcip}:{$rpcport}");
$databaseUser = "";
$databasePass = "";
$databaseName = "";
$dbTableName = "";
Db::Connect("mysql:dbname={$databaseName};host=localhost", $databaseUser, $databasePass);
if ($debug) {
    echo "<pre>" . print_r(GetInfo(), true) . "</pre>";
}
echo "Faucet Address: " . GetAddress() . ".<br>";
echo "Faucet Balance: " . GetBalance() . ".<br><br>";
$continue = true;
if (isset($_REQUEST["address"])) {
    if ($_SESSION["my_captcha"] == $_REQUEST["captcha"]) {
        $address = $_REQUEST["address"];
        if (strlen($address) == 34) {
            $result = GetFromFaucet($address);
            echo "The faucet has succesfully dispensed {$result["amount"]} to {$address}. <br><br>For reference see transaction: {$result["txid"]}";
            $continue = false;
        } else {
            echo "You have entered an incorrect address";
        }
    } else {
        echo "You have entered an invalid captcha!";
        $continue = true;