Submit Your Article Forum Rules

Results 1 to 3 of 3

Thread: looking for a search class for php

  1. #1
    Senior Member
    Join Date
    May 2004
    Posts
    199

    looking for a search class for php

    I have a basic search routine written in php I use on sites, but I was wondering if anyone
    has a favorite php class or code snippett they use that can search a database,
    AND employ logic operators (+, -, |) .. and maybe even quotes...
    all while avoiding malicious injection :)

    I can search hotscripts and the other myriad of script sites, but I would prefer
    something that someone can recommend and has experience with.

    Anything come to mind?

  2. #2
    WebProWorld MVP
    Join Date
    Aug 2003
    Posts
    1,039
    If you just want a class have a look at Zend framework which contains a port of Lucene http://framework.zend.com/manual/en/zend.search.html I've only played with it rather than using it for a real project.

    MySQL 4+ has full text search capabilities which you might find satisfies your needs http://dev.mysql.com/doc/refman/5.0/...xt-search.html

    If you're after a site search engine then have a look at http://cs.ioc.ee/~ando/sphider/ I did play with it a while ago but never used it in anger.

    Which is best all depends on what you are trying to achieve.

  3. #3
    Just a note to tell people to look for the use of something like...

    $sql .= "and fieldname = '" . addslashes($fieldvalue) . "'";

    Of course this can depend on whether or not slashes are added automatically... but if they are, then they mess up on page displays, perhaps doubling up on form redisplay, and may be stripped out anyway (if the feature isn't turned off entirely on your server).

    A lot of amateur code contains almost zero protection against SQL shenanigans or field values not constrained by use of a browser form to generate GET/POST values.

Similar Threads

  1. PHP property class
    By preetvasan in forum IT Discussion Forum
    Replies: 2
    Last Post: 09-11-2009, 01:58 AM
  2. adding "span class" tag in DW - not just "class" tag
    By johnnygphotography in forum Graphics & Design Discussion Forum
    Replies: 2
    Last Post: 08-12-2008, 04:50 PM
  3. Awesome UC Berkeley Class On Search & Webcasts Available
    By WPW_Feedbot in forum Search Engine Optimization Forum
    Replies: 0
    Last Post: 09-14-2005, 10:00 AM
  4. Time's Top 50 Sites & Search In Class Of Its Own
    By WPW_Feedbot in forum Search Engine Optimization Forum
    Replies: 0
    Last Post: 06-23-2005, 11:00 AM
  5. Copernic Desktop Search Wins 2005 World Class Award From PC
    By WPW_Feedbot in forum Search Engine Optimization Forum
    Replies: 0
    Last Post: 06-01-2005, 12:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •