Do you have a question? Post it now! No Registration Necessary. Now with pictures!
August 18, 2004, 7:48 am
rate this thread
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
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
And by the way, do you have better solutions to do the In-Site search
without using MYSQL?
Re: Site Search
> 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
> that keyword(s).
> My problem is how to avoid searching the tags?
> For example, when user typed in "$PHPSELF", how to avoid
> code within <?php ?> tag? Also, how to avoid searching the
> in other tags?
> Assume that the server doesn’t have MYSQL installed, and no
> index file
> is made.
> And by the way, do you have better solutions to do the In-Site
> without using MYSQL?
KC, you are much better off simply putting in one of the many free
site search buttons. Google has one, and so do others. You are done
in 5 minutes vs. spending quite a few days, and never getting it to
work quite right. Just my 2 cents.
http://www.dbForumz.com / This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/PHP-Site-Search-ftopict140737.html
Visit Topic URL to contact author (reg. req'd). Report abuse:
Re: Site Search
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