How can I limit the search results found? If someone tries a blank search he can access all my records. I would like to give him an error to tell him to refine his search, or to display only 10 or so records.
Excuse my english. Thank you
Search results.
6 posts
• Page 1 of 1
Dataface uses the -limit GET parameter to set the number of records. So if you add this parameter at the beginning of your index.php file, it will enforce a limit;
e.g. index.php:
For now , it is done in some rudimentary way. If user tries to search for a string that will display too many results it will give him an error. I've tried to limit the search results displayed by forcing the user to search for more than three characters.
if ( isset($_GET['-search']) ){ if(strlen($_GET['-search']) < 3) { header('Location: http://www.blah.com/error'); } } Someone can still browse through my database by entering a blank search in the advanced search form (-action=find).
Yes.. you're on the right track.
In your index.php file: $resultSet =& $app->getResultSet(); $resultSet->loadSet(); if ( $resultSet->found() > 100 ){ ....} else { ...}
6 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 37 guests |