header( "Content-Type: text/html; Charset=euc-jp" );
header( "pragma: no-cache" );
header( "Expires: Wed, 31 May 2000 14:59:58 GMT" );
header( "Cache-control: no-cache" );
require_once( "./mwin.php" );
$Target = substr( $_SERVER['HTTP_REFERER'], 0, 28 );
mb_language( "ja" );
mb_internal_encoding("EUC-JP");
foreach( $_POST as $Key => $Value ) {
$_POST[$Key] = str_replace("\\\\", "\\", $Value );
$_POST[$Key] = str_replace("\\'", "'", $_POST[$Key] );
$_POST[$Key] = str_replace("\\\"", "\"", $_POST[$Key] );
}
$_GET = $_POST;
?>
PHP 雛形
if ( trim( $_GET['text'] ) == '' ) {
// print "対象データを入力して下さい";
exit();
}
if ( trim( $_GET['pattern'] ) == '' ) {
print "パターンを入力して下さい";
exit();
}
if ( substr( $_GET['text'], 0, 4 ) == 'http' ) {
$ret = @file_get_contents( $_GET['text'] );
if ( $ret !== FALSE ) {
$enc = mb_detect_encoding($ret, "SJIS,UTF-8,EUC-JP");
if ( $enc == 'SJIS' || $enc == 'UTF-8' ) {
$ret = mb_convert_encoding ( $ret, "EUC-JP", $enc );
}
$_GET['text'] = $ret;
}
}
mb_ereg_search_init( $_GET['text'], $_GET['pattern'], "i" );
while( TRUE === mb_ereg_search() ) {
$work = mb_ereg_search_getregs();
$ncnt = 0;
foreach( $work as $Key => $Value ) {
$Value = mb_ereg_replace( "&", "&", $Value );
$Value = mb_ereg_replace( "<", "<", $Value );
$matches[$ncnt][] = mb_ereg_replace( ">", ">", $Value );
$ncnt++;
}
}
print "";
print "[0] は、マッチした全体の文字列を指す\n";
print "それ以外は () によってマッチした部分文字列\n";
print_r($matches);
print "
";
?>
if ( $Target == 'http://lightbox.on.coocan.jp' ) { ?>
} ?>