<?php
/*
*声明 本源码是 原创
*不得用于非法，否则后果自行承担
不得不经作者同意随意倒卖！
倒卖之前需要经过作者同意方可*成为合伙人
*
*/
ob_start();//在服务器打开一个缓冲区来保存所有的输出
$word=$_GET['s'];
$word=preg_replace('/\（(.*?)\）/',"",$word);
$word=preg_replace('/\((.*?)\)/',"",$word);
preg_match_all("/(.*?)(?:\.html)/i", $word, $wd);
$wd[1][0]=trim($wd[1][0],",.!@#$%^&*，。《》{}【】\/");
if (ctype_alnum($wd[1][0])){
    echo "对不起！你访问的页面不存在。<a href='/'>返回首页</a>";
    echo'<script>console.log("每一个星球都有一个驱动核心，\n每一种思想都有影响力的种子。\n感受世界的温度，\n年轻的你也能成为改变世界的动力，\n珍惜你所有的潜力。\n你的潜力，是改变世界的动力！\n\n");</script>';
    exit;
}else if(strpos($word,'.html') !== false){
$guanjianci=md5($wd[1][0]);
if(!is_file(''.$guanjianci.'.html')){
    require_once("moban.php");
    file_put_contents(''.$guanjianci.'.html',ob_get_contents());
    header("HTTP/1.1 301 Moved Permanently");
    header('Location:'.$guanjianci.'.html');
    exit;    
}else{
        header("HTTP/1.1 301 Moved Permanently");
        header('Location:'.$guanjianci.'.html');         
        exit;
    }
}else{
    
    echo '<title>对不起！你访问的《'.$word.'》页面不存在 - 404</title></head><body>对不起！你访问的《'.$word.'》页面不存在，是不是要；？。<a href="/">返回首页</a>'; 
    echo'<script>console.log("每一个星球都有一个驱动核心，\n每一种思想都有影响力的种子。\n感受世界的温度，\n年轻的你也能成为改变世界的动力，\n珍惜你所有的潜力。\n你的潜力，是改变世界的动力！\n\n");</script>';
    exit;
}
function str_encode($string){ 
    $hex="";
    for($i=0;$i<strlen($string);$i++)
    $hex.=dechex(ord($string[$i]));
    $hex=strtolower($hex);
    return $hex;
}

?>