Introducing MWH in the index page and commenrted out with html tags # Copyright (C) 2001 Fahad Al-Awadi (info@panoramika.com) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. $LINKS= array (); $FILES= array (); $index= array ('index.php'); $replace= ""; if ($find=="") print "Please enter a word you wish to search for"; // Output error message if no word else { while ($index!=1) $index = array_walk ($index, 'Process'); foreach ($LINKS as $links) { foreach ($FILES as $files) { if (ereg ($files, $links)) $conclusion[$links]= $files; } } foreach($conclusion as $links => $files) { if ($files!="" && is_file($files)) { //$entries= file ($files); //$contents= implode (" ", $entries); $contents=file_get_contents ($file); // contents of the file put in an array $text= strip_tags ("$contents"); } $conclusion2[$links]= $text; } foreach($conclusion2 as $links => $text) { if (preg_match ("/\b$find\b/i", $text, $founded)) { $number[] =count ($founded); $conclusion3[$links]= $text; } } if (!empty($number)) { $total_matches= array_sum ($number); if ($total_matches >1) $s= 's'; print "Your search for '$find' has found in $total_matches page".$s."
"; $n=1; foreach($conclusion3 as $links => $text) { $text= stristr($text, "$find"); $text_r = preg_replace ("/\b$find\b/i", $replace, $text); print "
$links
$text_r"; if (count ($conclusion3)-$n!=0)print '