Guest User

Untitled

a guest
Aug 19th, 2017
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 KB | None | 0 0
  1. <?php
  2. header('Content-Type: text/html; charset=UTF-8');
  3. session_start();
  4. date_default_timezone_set('Asia/Kolkata');
  5. if(isset($_COOKIE['submits'])){
  6. $submit_date = $_COOKIE['submit_date'];
  7. $submits = $_COOKIE['submits'];
  8. } else {
  9. $submit_date = date("Y/m/d");
  10. $submits = 0;
  11. }
  12. $today = date("Y/m/d");
  13. if($today == $submit_date){
  14. if($submits >= 3){
  15. $nosubmits = "true";
  16. }
  17. } else {
  18. $submits = 0;
  19. setcookie("submits", 0, time() + (86400 * 30), "/");
  20. setcookie("submit_date", date("Y/m/d"), time() + (86400 *30), "/");
  21. }
  22.  
  23. $host = "localhost"; //database host
  24. $username = "username"; // database username
  25. $password = "password"; //database password
  26. $dbname = "dbname"; //database name
  27.  
  28. $ip = getenv("REMOTE_ADDR") ;
  29. $time = time();
  30. $waktu = date("G:i:s",time());
  31. //database connect
  32. mysql_connect($host,$username,$password) or die(mysql_error());
  33. mysql_select_db($dbname) or die(mysql_error());
  34. mysql_query("SET NAMES utf8");
  35.  
  36. mysql_query("CREATE TABLE IF NOT EXISTS `cookies` (
  37. `ip` varchar(32) NOT NULL DEFAULT '',
  38. `time` varchar(32) DEFAULT NULL,
  39. `waktu` varchar(255) DEFAULT NULL,
  40. PRIMARY KEY (`ip`)
  41. ENGINE=MyISAM DEFAULT CHARSET=utf8;
  42. )
  43. ");
  44.  
  45. $ref = $_SERVER['HTTP_REFERER'];
  46. $referer = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
  47. if (strpos($ref,'http://usaliker.com') !== false) {
  48. } else {
  49. if (strpos($ref,'http://usaliker.com') !== true) {
  50. } else{
  51. header("Location: http://usaliker.com/url/$referer");
  52.  
  53. }
  54. }
  55. function get_html($url) {
  56. $ch = curl_init();
  57. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  58. curl_setopt($ch, CURLOPT_URL, $url);
  59. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  60. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  61. curl_setopt($ch, CURLOPT_FAILONERROR, 0);
  62. $data = curl_exec($ch);
  63. curl_close($ch);
  64. return $data;
  65. }
  66. $token = $_SESSION['access_token'];
  67.  
  68. if($token){
  69. $graph_url ="https://graph.facebook.com/me?fields=id,name&access_token=" . $token;
  70. $user = json_decode(get_html($graph_url));
  71. if ($user->error) {
  72. if ($user->error->type== "OAuthException") {
  73. session_destroy();
  74. header('Location: index.php?i=1');
  75. }
  76. }
  77. }
  78. else{
  79. header('Location: index.php?type=likesent');
  80. }
  81. $result = mysql_query("
  82. SELECT * FROM cookie WHERE ip = '$ip'");
  83. if($result){
  84. while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
  85. $times = $row;
  86. }
  87. $timer = time()- $times['time'];
  88. $countdown = 900 - $timer;
  89. };
  90. if(isset($_POST['submit'])) {
  91. $token = $_SESSION['access_token'];
  92. if(!isset($token)){exit;}
  93. $postid = $_POST['id'];
  94. if(isset($postid)){
  95. if (time()- $times['time'] < 900){
  96. header("Location: index.php?i=5");
  97. }
  98. else{
  99.  
  100. mysql_query("REPLACE INTO cookie (ip,time,waktu) VALUES ( '$ip','$time','$waktu')");
  101. $ch = curl_init('http://urlikesendinfile.php');
  102. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  103. curl_setopt ($ch, CURLOPT_POST, 1);
  104. curl_setopt ($ch, CURLOPT_POSTFIELDS, "id=$postid");
  105. curl_setopt ($ch, CURLOPT_TIMEOUT, 4);
  106. $hasil = curl_exec ($ch);
  107. curl_close ($ch);
  108. if (strpos($hasil,'GAGAL') !== false) {
  109. echo '<script type="text/javascript">alert("INFO: Somethings was wrong \n :: \n HINTS: \n :: \n [+] Make Sure you was entering a Valid PostID \n [+] Your Post Must Be PUBLIC \n :: \n Please retry your request later.");</script>';
  110. }else{
  111. //header("Location: liker.php?i=Liking In Process, We are Prosessing your request, Estimate finish is 5 Mins depend on our server traffic");
  112. header("Location: index.php?type=likesent");
  113. }
  114. }
  115. }else{
  116. header("Location: index.php?i=Post ID is Empty");
  117. };
  118. }else{
Add Comment
Please, Sign In to add comment