<?php
//require("config.inc.php");
function get_msg($path) {
global $key, $i;
$handle = opendir($path);
while ($filename = readdir($handle)) {
//echo $path."/".$filename."<br>";
$newpath = $path."/".$filename;
$check_type = preg_match("/\.html?$/", $filename);
if (is_file($newpath) && $check_type) {
$fp = fopen($newpath, "r");
$msg = fread($fp, filesize($newpath));
fclose($fp);
match_show($key, $msg, $newpath, $filename);
}
if (is_dir($path."/".$filename) && ($filename != ".") && ($filename != "..")) {
//echo "<BR><BR><BR>".$newpath."<BR><BR><BR>";
get_msg($path."/".$filename);
}
}
closedir($handle);
return $i;
}
function match_show($key, $msg, $newpath, $filename) {
global $key, $i;
$key = chop($key);
if ($key) {
$msg = preg_replace("/<style>.+<\/style>/is", "", $msg);
$msg = str_replace(" ", "", $msg);
$msg = preg_replace("/<[^>]+>/", "", $msg);
$value = preg_match("/.*$key.*/i",&n
//require("config.inc.php");
function get_msg($path) {
global $key, $i;
$handle = opendir($path);
while ($filename = readdir($handle)) {
//echo $path."/".$filename."<br>";
$newpath = $path."/".$filename;
$check_type = preg_match("/\.html?$/", $filename);
if (is_file($newpath) && $check_type) {
$fp = fopen($newpath, "r");
$msg = fread($fp, filesize($newpath));
fclose($fp);
match_show($key, $msg, $newpath, $filename);
}
if (is_dir($path."/".$filename) && ($filename != ".") && ($filename != "..")) {
//echo "<BR><BR><BR>".$newpath."<BR><BR><BR>";
get_msg($path."/".$filename);
}
}
closedir($handle);
return $i;
}
function match_show($key, $msg, $newpath, $filename) {
global $key, $i;
$key = chop($key);
if ($key) {
$msg = preg_replace("/<style>.+<\/style>/is", "", $msg);
$msg = str_replace(" ", "", $msg);
$msg = preg_replace("/<[^>]+>/", "", $msg);
$value = preg_match("/.*$key.*/i",&n
| 对此文章发表了评论 |
