Search page text

greg's picture

He has: 1,581 posts

Joined: Nov 2005

I'm making a site search function, and would like to search the page text.
The search code will be on the same site as the text/pages being searched for.

The only idea I had was to open files and search the text. But apart from security issues surrounding this from "finding" PHP code, it's obviously not ideal for speed purposes either.

Any suggestions?

They have: 121 posts

Joined: Aug 2008

Greg,

Personally - need a search function, then go to the experts. I would use the Google Custom Search Engine (http://www.google.com/coop/cse/). You can even make a few quid through adsense going down this route.

Assuming your website is a flat file site (ie. not run by a database) and not supported by a CMS, then I would def go down the Google CSE route.

serpico

greg's picture

He has: 1,581 posts

Joined: Nov 2005

Yeah, I suppose it would be the method to use.

I wanted to do my own to have a bit more control over it, and it's interesting, but if I scratch my head any more I'll be bald.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.