WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-30-2007, 04:45 PM
WebProWorld Pro
 

Join Date: May 2004
Location: Austin, TX
Posts: 199
steve0 RepRank 0
Default 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?
__________________
Hardcore Programming Solutions and Coffee Drinker
Reply With Quote
  #2 (permalink)  
Old 05-01-2007, 07:27 AM
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Cornwall, UK
Posts: 833
speed RepRank 1
Default

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.
__________________
TOLRA Micro Systems Limited US & UK Web Hosting with Continuous Data Protection
Web Directory 2 for 1 Offer : Web Directory Script
Reply With Quote
  #3 (permalink)  
Old 05-04-2007, 05:27 PM
WebProWorld Member
 

Join Date: May 2006
Location: Sol System
Posts: 39
Grokodile RepRank 0
Default

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.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0