Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['data'])) {
- include_once 'config.php';
- $data = unserialize($_POST['data']);
- $query = "SELECT * FROM `vote_data` WHERE `ip` = ?";
- $pre = $con->prepare($query);
- $ip = $data[0];
- define(TOPG_CHECK,"http://topg.org/check_ip.php?siteid=412839&userip=".$ip); //replace SITEID with yours
- $voted = @file_get_contents(TOPG_CHECK); //check url to see response for UserIP
- if($voted)
- {
- file_get_contents("http://awaken-ps.com/vote/cb/cburl.php?p_resp=".$ip);
- }
- $pre->execute(array($ip));
- $results = $pre->fetchAll(PDO::FETCH_ASSOC);
- $vals = array("time" => 0, "voted" => 0, "sites_done" => 0);
- if($results[0]['claimedTime'] > time()) {
- $vals['time'] = date("H:i:s", $results[0]['claimedTime']-time());
- $vals['voted'] = 1;
- }
- $vals['sites_done'] = $results[0]['callback_1'] + $results[0]['callback_2'];
- echo json_encode($vals);
- } else {
- echo 'Failed';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement