Re: Newbie: Site search, more than one directory
| From: | Jeffrey Paul | Date: | Wed, 01 Aug 2001 10:24:57 +0000 |
| Subject: | Re: Newbie: Site search, more than one directory | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-60618@lists.php.net to get a copy of this message | ||
At 04:11 PM 8/30/2001, Steve Wright wrote:
Hey, I have just developed a simple site search.. .and am after learning how to get it to search all directories... at present, it only searches the one it is in!!<snip>
"man grep" on my linux box shows:$cmdstr = "grep -i $searchstr *";
-r, --recursive
Read all files under each directory, recursively; this is equivalent to the -d recurse
option.
change it to:
$cmdstr = "grep -r -i $searchstr *";
In all honesty though, you might want to use an ereg_replace() on $searchstr before doing that, so that special shell characters can't get through.
Interesting take on searching...
-j
--------------------------------------------------
sneak@datavibe.net - 0xF50BB9D7A21A FD82 8C30 EC77 CCCC 545D A0B3 F501 F50B B9D7
ICQ: 14295546 - AIM: kw34hd1