// check if user select click a link if (isset($_POST['link']) && $config_link['status'] == 'on') { $opts = array( "http" => array( "method" => "GET", "header" => "Content-type: application/x-www-form-urlencoded\r\n", "timeout" => 6, ), ); $context = stream_context_create($opts); $key = get_token(10); for ($i=1; $i <= count($link) ; $i++) { if (!isset($_COOKIE[$i])) { log_user($address, $ip); $url = $link[$i]; $go = str_replace("{key}",$key,$url); $ShortenedResult = @json_decode(file_get_contents( $go, false, $context), true); while (empty($ShortenedResult['shortenedUrl']) { $i++; $url = ''; $go = ''; $ShortenedResult = ''; $url = $link[$i]; $go = str_replace("{key}",$key,$url); $ShortenedResult = @json_decode(file_get_contents( $go, false, $context), true); } setcookie($i, 'visited', time() + 0); header("Location: ". $ShortenedResult['shortenedUrl']); $mysqli->query("INSERT INTO link (bitcoin_address, sec_key) VALUES ('$address', '$key')"); echo ''; die(); } } } else { if (isset($_COOKIE['ref']) && $address !== $_COOKIE['ref']) { $ref = $mysqli->real_escape_string($_COOKIE['ref']); } $send = send_hub($address, $ip); if ($send['success'] == true) { log_user($address, $ip); $send_reward = 1; UpdateClaimLimit($address); } $alert = "

{$send['html']}
"; }