Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Content-Type: text/html; charset=UTF-8');
- session_start();
- date_default_timezone_set('Asia/Kolkata');
- if(isset($_COOKIE['submits'])){
- $submit_date = $_COOKIE['submit_date'];
- $submits = $_COOKIE['submits'];
- } else {
- $submit_date = date("Y/m/d");
- $submits = 0;
- }
- $today = date("Y/m/d");
- if($today == $submit_date){
- if($submits >= 3){
- $nosubmits = "true";
- }
- } else {
- $submits = 0;
- setcookie("submits", 0, time() + (86400 * 30), "/");
- setcookie("submit_date", date("Y/m/d"), time() + (86400 *30), "/");
- }
- $host = "localhost"; //database host
- $username = "username"; // database username
- $password = "password"; //database password
- $dbname = "dbname"; //database name
- $ip = getenv("REMOTE_ADDR") ;
- $time = time();
- $waktu = date("G:i:s",time());
- //database connect
- mysql_connect($host,$username,$password) or die(mysql_error());
- mysql_select_db($dbname) or die(mysql_error());
- mysql_query("SET NAMES utf8");
- mysql_query("CREATE TABLE IF NOT EXISTS `cookies` (
- `ip` varchar(32) NOT NULL DEFAULT '',
- `time` varchar(32) DEFAULT NULL,
- `waktu` varchar(255) DEFAULT NULL,
- PRIMARY KEY (`ip`)
- ENGINE=MyISAM DEFAULT CHARSET=utf8;
- )
- ");
- $ref = $_SERVER['HTTP_REFERER'];
- $referer = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
- if (strpos($ref,'http://usaliker.com') !== false) {
- } else {
- if (strpos($ref,'http://usaliker.com') !== true) {
- } else{
- header("Location: http://usaliker.com/url/$referer");
- }
- }
- function get_html($url) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_FAILONERROR, 0);
- $data = curl_exec($ch);
- curl_close($ch);
- return $data;
- }
- $token = $_SESSION['access_token'];
- if($token){
- $graph_url ="https://graph.facebook.com/me?fields=id,name&access_token=" . $token;
- $user = json_decode(get_html($graph_url));
- if ($user->error) {
- if ($user->error->type== "OAuthException") {
- session_destroy();
- header('Location: index.php?i=1');
- }
- }
- }
- else{
- header('Location: index.php?type=likesent');
- }
- $result = mysql_query("
- SELECT * FROM cookie WHERE ip = '$ip'");
- if($result){
- while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
- $times = $row;
- }
- $timer = time()- $times['time'];
- $countdown = 900 - $timer;
- };
- if(isset($_POST['submit'])) {
- $token = $_SESSION['access_token'];
- if(!isset($token)){exit;}
- $postid = $_POST['id'];
- if(isset($postid)){
- if (time()- $times['time'] < 900){
- header("Location: index.php?i=5");
- }
- else{
- mysql_query("REPLACE INTO cookie (ip,time,waktu) VALUES ( '$ip','$time','$waktu')");
- $ch = curl_init('http://urlikesendinfile.php');
- curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt ($ch, CURLOPT_POST, 1);
- curl_setopt ($ch, CURLOPT_POSTFIELDS, "id=$postid");
- curl_setopt ($ch, CURLOPT_TIMEOUT, 4);
- $hasil = curl_exec ($ch);
- curl_close ($ch);
- if (strpos($hasil,'GAGAL') !== false) {
- 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>';
- }else{
- //header("Location: liker.php?i=Liking In Process, We are Prosessing your request, Estimate finish is 5 Mins depend on our server traffic");
- header("Location: index.php?type=likesent");
- }
- }
- }else{
- header("Location: index.php?i=Post ID is Empty");
- };
- }else{
Add Comment
Please, Sign In to add comment