header( "Content-Type: text/html; Charset=utf-8" ); header( "Expires: Wed, 31 May 2000 14:59:58 GMT" ); mb_language( "ja" ); mb_internal_encoding("utf-8"); $rootDir = "/homepage"; //$rootDir = "C:\\user\\php"; $curTime = filemtime( "./index.php" ); $rootTime = filemtime( "$rootDir/index.php" ); $redirect = false; if ( $curTime != $rootTime ) { // print "$curTime/$rootTime"; copy("$rootDir/index.php", "./index.php" ); touch("./index.php", $rootTime ); header( "Location: ./index.php" ); file_put_contents("log.txt","redirect"); exit(); } ?>
|
|
|
SQLの窓 : インデックストップ
SQLの窓 : 技術情報セクション Ⅰ SQLの窓 : 技術情報セクション Ⅱ SQLの窓 : 技術情報セクション Ⅲ : ソース掲示板 SQLの窓 : 技術情報セクション Ⅳ : 銀プロ SQLの窓 : 技術情報セクション Ⅴ : logical error Web Amusement Hyper Activity Land
$txt_array = @file( "exclude.txt" );
$txt_flg = @file( "$rootDir/renew.txt" );
$DirHandle = @opendir('./');
$file_array = array();
if ( $DirHandle ) {
$Target = readdir( $DirHandle );
while( $Target !== false ) {
if ( !file_exists( "$Target/index.php" ) && is_dir($Target) && $Target != "." && $Target != ".." ) {
copy("$rootDir/index.php", "$Target/index.php" );
}
else {
if ( file_exists( "$Target/index.php" ) && is_dir($Target) && $Target != "." && $Target != ".." ) {
if( trim( $txt_flg[0] ) == "1" ) {
copy("$rootDir/index.php", "$Target/index.php" );
}
}
}
$file_array[] = $Target;
$Target = readdir( $DirHandle );
}
closedir( $DirHandle );
}
if ( $file_array ) {
sort($file_array);
foreach ($file_array as $fvalue) {
if ( $txt_array ) {
foreach ($txt_array as $value) {
if ( $fvalue == trim($value) ) {
continue 2;
}
}
}
if ( $fvalue == "exclude.txt" ) {
continue;
}
if ( $fvalue != "." && $fvalue != "index.php" ) {
EditListData( $fvalue );
}
}
}
# **********************************************************
# データの編集
# **********************************************************
function EditListData( $Target ) {
if ( is_dir( "./$Target" ) ) {
$Target = "$Target";
$out_data = " \n"; print $out_data; } else { $path_info = pathinfo( $Target ); if ( $path_info['extension'] == 'htm' || $path_info['extension'] == 'html' || $path_info['extension'] == 'php' ) { $handle = fopen($Target, "r"); $work = ""; for( $i = 0; $i < 10; $i++ ) { $work .= fgets( $handle ); } fclose($handle); // $work = file_get_contents( $Target ); $matches = array(); if ( preg_match( "/[Tt][Ii][Tt][Ll][Ee]\s*>([^<]+)", $work, $matches ) > 0 ) { $matches[1] = mb_convert_encoding($matches[1], "utf-8", "EUC-JP,shift_jis, utf-8"); if ( trim($matches[1]) != "" ) { $Target = "{$matches[1]}"; } else { $Target = "$Target"; } } else { $Target = "$Target"; } $out_data = " \n"; print $out_data; } if ( $path_info['extension'] == 'js' || $path_info['extension'] == 'wsf' || $path_info['extension'] == 'reg' || $path_info['extension'] == 'lzh' || $path_info['extension'] == 'zip' || $path_info['extension'] == 'cgi' ) { $Target = "$Target"; $out_data = " \n"; print $out_data; } if ( $path_info['extension'] == 'swf' ) { $Target = "$Target"; $out_data = " {$Target}\n"; print $out_data; } } } ?> |
if ( $_SERVER["HTTP_HOST"] == 'winofsql.jp' ) {?>
} ?> |