daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest May 7th, 2016 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     if (session_status() !== PHP_SESSION_ACTIVE) {session_start();}
  3.     header('Access-Control-Allow-Origin: *');  
  4.  
  5.     // Настройки базы слов
  6.     define('HARD', 'stop.txt');
  7.     define('ADULT', 'des.txt');
  8.     define('LITE', 'aw.txt');
  9.  
  10.        
  11.     if (!isset($_SESSION['clock'])) {
  12.         if (isset($_SERVER["HTTP_REFERER"])) {
  13.             $url = parse_url($_SERVER["HTTP_REFERER"]);
  14.             $host = str_replace('www.', '', $url['host']);
  15.             if($host == $_SERVER['HTTP_HOST']) {
  16.                 $_SESSION['clock'] = false;
  17.             }
  18.             $db_host = '';
  19.             $db_name = '';
  20.             $db_user = '';
  21.             $db_pass = '';
  22.             $dbh = new PDO('mysql:host='.$db_host.';dbname='.$db_name, $db_user, $db_pass);
  23.             $sql = $dbh->query("SELECT  COUNT(*) FROM `traders` WHERE `domain`='$host'");
  24.             $count = $sql->fetchColumn();
  25.             if ($count) {
  26.                 $_SESSION['clock'] = true;
  27.             } else {
  28.                 $_SESSION['clock'] = false;
  29.             }
  30.         } else {
  31.             $_SESSION['clock'] = false;
  32.         }
  33.     }
  34. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand