Login
Sponsor
Sponsor
Sponsors
Sponsor
Sponsors
Sponsor
Sponsor
Sponsor
Sponsor

Sponsor
Sponsor
Sponsor
Sponsor

This search tool is perfect if you want a quick an easy way to search your dynamic websites. Simply upload the search.php file and make a form on your website like below and you’re done! It couldn’t be easier!

<form action="search.php" method="GET">
<input name="search" type="text" />
<input name="go" type="submit" value="Search Website" />
</form>

Features include:

  • Easy to install and configure
  • Searches all pages on your website (even search multiple websites!)
  • Super fast searching!
  • No database required – even easier to install!
  • Finds matching file names (eg: searching for ‘report’ will find a file called ‘latest report .doc‘)
  • Finds matches in HTML META tags
  • Finds matches in url’s (eg: searching for ‘products’ will find a file called ‘/website/my- products .html‘)
  • It will even search INSIDE PDF DOCUMENTS!
  • The results are sorted by relevance in a page-by-page view similar to Google.
  • The text that displays under each search result is trimmed to a certain length so it fits on the page nicely.
  • Any matching keywords in the results are highlighted so the user can see why that result was returned.
  • Advanced users:
    A custom callback function is included so you can insert your own results in with normal HTML results (eg: by querying a database of products for a match). This makes for great search integration between different products on an existing website.

Note: pdf document support is only available on Linux hosting accounts that have “pdftotext” installed. Please contact your hosting provider to check if pdftotext is installed.

Configuration:

You can control the following options:

  • Which website addresses (URL’s) to search
  • Which file names to ignore and never display in search results
  • How many results to display on each page
  • Plus many more advanced settings in the config.php file
  • There is an easy to use admin page which helps you configure these.

Advantages

The advantages of something like this over a google integrated solution

  • You can style it the way you want
  • Instant search results (no waiting weeks for Google to index your new website)
  • Customers don’t bug you that the search isn’t picking up the latest results
  • Control over exactly when the indexer will scrape your updated website content again
  • It can index “every” page of your website, something that Google may not do or take a long time to do
  • Custom callback function so advanced users can integrate a mysql query and inject custom results into the list
  • No advertising (customers don’t like ads on their professional looking websites)
  • It has an awesome highlighting feature

Requirements

  • PHP5
  • Linux hosting account (have not tested on Windows but it should work)
  • “pdftotext” utility installed if you wish to search PDF files (contact your hosting provider to see if it is installed)
  • Know how to upload files to your website (eg: with FTP )
  • Know some basic HTML /CSS so you can style the search results page (to suit your look & feel) if the defaults do not work.

How to install:

  1. Unzip the file from CodeCanyon
  2. Upload search.php to your website (eg: yourwebsite.com/search.php)
  3. Upload phpsearch_files/ folder to your website (eg: yourwebsite.com/phpsearch_files/)
  4. Visit the administration page by going to yourwebsite.com/phpsearch_files/admin.php
  5. Set “write” permissions via FTP remote view on the phpsearch_files/search_cache/ folder (contact me if you get stuck doing this)
  6. Create a form on your website like this:
  7. Done
    (replace yourwebsite.com with your actual website address above)

How to style the search results page:

  1. Open the phpsearch_files/header.php file in Notepad or your favorite HTML editor (eg: Dreamweaver)
  2. Delete any default HTML content from this file.
  3. Copy & Paste any HTML code you would like to display above the search results into this file.
  4. Open the phpsearch_files/footer.php file in Notepad or your favorite HTML editor (eg: Dreamweaver)
  5. Delete any default HTML content from this file.
  6. Copy & Paste any HTML code you would like to display below the search results into this file.
  7. Advanced users: you can do PHP includes eg: <?php include(“your_header_file.php”);?> into these two files.
  8. Advanced users: you can also <?php include(“search.php”);?> from one of your existing files to display results there.
  9. You can edit the CSS in phpsearch_files/phpsearch.css to match the colours to your website design if the defaults do not work.
  10. Done.

Please Login or Register to read the rest of this content.

2 Responses to “PHP Search Engine [By diegos]”

Leave a Reply

You must be logged in to post a comment.

Sponsors
Sponsors
Sponsor
MutoBay
Sponsor
Sponsor
Sponsor
Sponsor
Sponsors

HCG Ad

Sponsors
HCG
Sponsors
Sponsor
Sponsor
Who’s Online?

Total users online: 11
Guests online: 9
Registered online: 2; admin, ZsharE