コード例 #1
0
    $table = $_POST["table"];
    $choice = $_POST["choice"];
    $times = time();
    $url = getSHOST() . "?mode=choice&choice=" . $choice . "&branch=" . $branches[$bid] . "&token=" . $_COOKIE['token'];
    //echo $url."<br>";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_REFERER, "www.google.com");
    $body = curl_exec($ch);
    curl_close($ch);
    $key = substr($_COOKIE['keymas'], 0, 16);
    $cryptox = new Crypto($key);
    $cont = json_decode($body);
    $result = $cont->results;
    if ($bid == 0) {
        $resname = $cont->name;
        insertResult($resname, $table);
    }
    $count = dbproc($result, $table);
    $timee = time();
    $secs = $timee - $times;
    echo "<br><h4 style='color:white'>Fetched {$count} Records in {$secs}</h4>";
}
?>
</div>
</div>
</div>
</div></body>
</html>
コード例 #2
0
     curl_close($ch);
     $timee = time();
     //echo "<br><br>Time End ".$timee;
     echo "<br><h2>Got In " . ($timee - $times) . " seconds</h2>";
     $data = $body;
     include_once "aes/AES.class.php";
     $key = substr($_COOKIE['keymas'], 0, 16);
     $cryptox = new Crypto($key);
     $cont = json_decode($body);
     $result = $cont->results;
     $table = uniqid();
     $resname = $cont->name;
     insertResult($resname, $table);
     createTable($table);
     //print_r($result);
     dbproc($result, $table);
 } else {
     $branches = explode(":", $choicearray[2]);
     $cnt = count($branches);
     $table = uniqid();
     createTable($table);
     $chstring = $_POST["choices"][0];
     echo "<h2>Fetch Results</h2><br><br><br>";
     echo "<form action='phase3.php?bid=0' method='post'>";
     echo "<input type='hidden' name='chstring' value='{$chstring}'></input>";
     echo "<input type='hidden' name='choice' value='{$choice}'></input>";
     echo "<input type='hidden' name='table' value='{$table}'></input>";
     echo "<input type='hidden' name='cnt' value='{$cnt}'></input>";
     echo "<input type='submit' class='btn' name='sub' value='Proceed'></input>";
     echo "</form>";
 }