By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,902 Members | 1,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,902 IT Pros & Developers. It's quick & easy.

Site Search

P: n/a
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!

KC
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"KC Wong1" wrote:
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!

KC


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-Sea...ict140737.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=471682
Jul 17 '05 #2

P: n/a
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
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.