Advertisement
Guest User

Untitled

a guest
May 25th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. <?php
  2.  
  3. if(isset($_POST['data'])) {
  4.  
  5. include_once 'config.php';
  6.  
  7. $data = unserialize($_POST['data']);
  8.  
  9. $query = "SELECT * FROM `vote_data` WHERE `ip` = ?";
  10.  
  11. $pre = $con->prepare($query);
  12.  
  13. $ip = $data[0];
  14.  
  15. define(TOPG_CHECK,"http://topg.org/check_ip.php?siteid=412839&userip=".$ip); //replace SITEID with yours
  16. $voted = @file_get_contents(TOPG_CHECK); //check url to see response for UserIP
  17. if($voted)
  18. {
  19. file_get_contents("http://awaken-ps.com/vote/cb/cburl.php?p_resp=".$ip);
  20. }
  21.  
  22. $pre->execute(array($ip));
  23.  
  24. $results = $pre->fetchAll(PDO::FETCH_ASSOC);
  25.  
  26. $vals = array("time" => 0, "voted" => 0, "sites_done" => 0);
  27.  
  28. if($results[0]['claimedTime'] > time()) {
  29. $vals['time'] = date("H:i:s", $results[0]['claimedTime']-time());
  30. $vals['voted'] = 1;
  31. }
  32.  
  33. $vals['sites_done'] = $results[0]['callback_1'] + $results[0]['callback_2'];
  34.  
  35. echo json_encode($vals);
  36.  
  37. } else {
  38. echo 'Failed';
  39. }
  40.  
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement