<?php
header('content-type:text/html; charset=utf-8');


$_GET['url'] = preg_replace('/[\s\r\n\<\>\"\']+|javascript\:/i', '', $_GET['url']);


if (!empty($_GET['url'])) {
  @ require 'writable/set/set.php';
  //if (strpos($_GET['url'], 'http') === 0) {
    if (@ $_SERVER['HTTP_REFERER']) {
      if (get_root_domain(htmlspecialchars($_SERVER['HTTP_REFERER'])) != get_root_domain(rtrim($web['sitehttp'], '/'))) {
        die('Error!');
      }
    } else {
      @ require 'writable/set/set_sql.php';
      if (!isset($sql['db_err'])) {
        $db = db_conn();
      }
      if ($sql['db_err'] == '') {
        $result = db_query($db, 'SELECT COUNT(id) AS total FROM `'.$sql['pref'].''.$sql['data']['承载网址数据的表名'].'` WHERE http_name_style LIKE "%'.$_GET['url'].'%" LIMIT 1');
        $row = db_fetch($db, $result);
        if (abs($row['total']) == 0) {
          db_close($db);
          echo 'Error! The url to be passed does not exist in the url database.';
          die();
        }
        $result = NULL;
        unset($row);

      } else {
        echo $sql['db_err'];
        die();
      }

      db_close($db);
    }

    //die('HTTP_REFERER ERROR!');
    echo '<?xml version="1.0" encoding="UTF-8"?>';
    echo '<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>跳转提示：</title>
<style type="text/css">
<!--
body { text-align:center; margin:0; padding:10px; }
h2 { font-size:14px; color:#FF6600; }
.box { margin:50px auto; max-width:600px; background-color:#FFFFCC; border:1px dashed #339933; }
.in { line-height:30px; font-size:12px; }
-->
</style></head>
<body>
<div class="box">
<h2>提示：页面即将跳转至…</h2>
<div class="in">
<a href="'.$_GET['url'].'" id="a">'.$_GET['url'].'</a><br />
<a href="'.$_GET['url'].'">点击进入</a> <a href="javascript:void(0);" onclick="window.close();">关闭</a>';
  @ include 'writable/chuchuang/ad_juejinlian.txt';
  echo '
<script>
setTimeout(function(){
  clickButton("a");
}, 3000);
function clickButton(id) {
            if (document.all) {
                document.getElementById(id).click();
            }
            else {
                var evt = document.createEvent("MouseEvents");
                evt.initEvent("click", true, true);
                document.getElementById(id).dispatchEvent(evt);
            }
        }
</script>
</div>
</div>
</body>
</html>';
    die;
  //}

/*
  //header('location: '.$_GET['url'].'');
  echo '<?xml version="1.0" encoding="UTF-8"?>';
  echo '<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>跳转提示：</title>
</head>
<body>
<a href="'.$_GET['url'].'" id="a">正在进入...</a> <a href="javascript:void(0);" onclick="window.close();">关闭</a>
';
  @ include 'writable/chuchuang/ad_juejinlian.txt';
  echo '
<script>
function clickButton(id) {
            if (document.all) {
                document.getElementById(id).click();
            }
            else {
                var evt = document.createEvent("MouseEvents");
                evt.initEvent("click", true, true);
                document.getElementById(id).dispatchEvent(evt);
            }
        }
clickButton("a");
</script>
</body>
</html>
';

*/





} else {
  header('location: http://www.162100.com/');
}







?>