KC Wong a écrit :
I am making an In-Site Search for a website,
it is a PHP page where user can enter the keyword(s),
and then the page will read through all other html/php pages to find
that keyword(s).
My problem is how to avoid searching the tags?
For example, when user typed in "$PHPSELF", how to avoid searching the
code within <?php ?> tag? Also, how to avoid searching the attributes
in other tags?
Assume that the server doesn't have MYSQL installed, and no index file
is made.
Thanks!
And by the way, do you have better solutions to do the In-Site search
without using MYSQL?
Thanks!
You've already got some good answers and advices...
Now, if you insist on reinventing the wheel and rolling your own search
engine, there's also some documentation on the subject - at least the
source code of some free full-text indexers. The standard solution is to
have an index with words as keys and lists of matchings pages as values,
which quite easily fits PHP's associative arrays. And it's quite easy
(and fast) to serialize a PHP array and write it in a file. This
probably wouldn't do if you plan to kick google out of business, but for
a single, medium size site, this is surely enough !-)
my 2 cents
Bruno