PHP Search

xiaoxiao2021-03-06  88

Site Search. Search.php

Search box code (please separate as an HTML file, if you put it in the same directory in Search.php, no modification is required):

********************** ***************************** / Require ("search.inc"); if (function_exists ("set_time_limit" &&! get_cfg_var ('SAFE_MODE')) {set_time_limit (600);} Function Get_MSG ($ PATH) {Global $ Key, $ I; $ Handle = OpenDir ($ PATH); While ($ filename = readdir ($ handle)) {// Echo $ PATH. "/" $ filename. "
"; $ newpath = $ path. "/". $ filename; if (is_file ($ newpath) {$ fp = fopen ($ newpath, "r" $ msg = fread ($ FP, FileSize); Fclose ($ FP); Match_SHOW ($ KEY, $ MSG, $ NewPath, $ filename);} if (is_dir ($ PATH. "/". $ filename) && ($ filename! = ".") && ($ filename! = "..")) {// echo "


". $ newpath. "


"; get_msg ($ PATH." / ". $ Filename);}} closedir ($ hand); Return $ I;} Function Match_show ($ KEY, $ MSG, $ NewPath, $ filename) {global $ Ar, $ i; $ key = chop ($ key); if ($ key) {$ check_type = preg_match ("//. h Tml? $ / ", $ filename); if ($ check_type) {$ title = gethtimltle ($ msg);} $ msg = preg_replace (" /