Help - Search - Members - Calendar
Full Version: Simple site search in PHP
Invision Power Services > Community Forums > Community Web Design and Coding
Sebastian Mares
Hi!

Does anyone know a free script for performing simple site searches in PHP? I don't have the time to write my own one at the moment.

Regards,
Sebastian
SadJoker
http://www.digitalpoint.com/tools/search/

Check that out. wink.gif Your site must be in the Google index, however.
princetontiger
Depends how simple... you could just search a site using "<keyword> site:<url>" at Google.com.

php.net uses this method.
Danny
If your website is in the database, you could use a fulltext search or you could just use google.
DonWilson
Either way it's going to be very simple (using google) or very complicated depending upon how advanced your website is. If you use a database for the information than just search through that in the related tables or if it's just html files than use Google.
Sebastian Mares
The reason why I want to use this is for a custom 404 page for example where the user gets redirected to an outdated site by Google or Altavista for example, so I can't use their search engine. laughing.gif

The site does not use a database. I was thinking about defining a flat-file with keywords and corresponding URLs, like this:

vbspot-->/projects_vbspot.php
mares-->/about_sebastianmares.php
acd-->/projects_acd.php
donate-->/participate.php

If the user searches for "vbspot acd", the results "/projects_vbspot.php" and "/projects_acd.php" should be displayed.
Brendon Koz
I think with something like this, you'd be better off looking for a Perl script, not a PHP script. Head on over to Hotscripts.com, I'm quite sure you'll find a bunch of different free scripts. You'll have to see for yourself which ones work and which do not, however. I've never used them before.

(Perl should be quicker than PHP for this. You can always call Perl scripts through a PHP page though, if you want to keep the extension the same.)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.