WorldWideScripts.net Delivering the best Add-Ons in more than 37 languages.

中文(简体), English, हिन्दी/हिंदी, Español/Castellano, العربية, Русский язык, Français, 中文 (台灣), বাংলা, Bahasa Indonesia, اردو, Português, Deutsch, Bahasa Melayu (بهاس ملايو‎), 日本語 (にほんご), فارسی, Italiano, తెలుగు, Türkçe, ગુજરાતી, Język polski/polszczyzna, Tiếng Việt, ಕನ್ನಡ, Українська мова, ไทย
PHP Scripts / Search

Static HTML Website Search Tool

— Add-On to WorldWideScripts.net

Subscribe to our feed to stay up to date!

New! Follow us as you want it!


Static HTML Website Search Tool - WorldWideScripts.net Item for Sale

Ads

Ad: Bluehost hosting
Get up to date PHP Scripts from dtbaker Try online demonstration for free Follow on Twitter Get Email Support

Easy HTML Website Search Tool in PHP – search html files on your website

UPDATE !a better version of this item is available as a PHP Search Engine. Please click here for more informationthe simple PHP search engine.

Who is this for?

  • Anyone with a normal HTML website that wants a quick and easy way to add a search field to their website
  • A folder full of PDF ’s that you want to index and make searchable via your website
  • Search feature on a intranet website that normal search engines cannot index
  • Anyone not happy with restrictions in tools such as Google embedded search
  • Adding an instant search feature to a new website, when tools like Google may take months to index every page, file, and PDF on your website
  • Someone who wants file names in a folder (eg: word documents, zip files) to be searchable and returned in results
  • Advanced users can use the php callback function to inject custom items into the result set, eg: by quering a mysql database of products for the search query (example provided)

Demo’s

Live Preview #1
Live Preview #2
Live Preview #3
Live Preview #4
Live Preview Admin Page

Features include

  • Easy to install and configure
  • Searches all HTML files on your website
  • 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 INSIDEPDFDOCUMENTS!
  • 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 folders to search for HTML files
  • Which folders to search for DOCUMENTS (eg: word, pdf, jpeg, mov)
  • 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.

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 WorldWideScripts.net
  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
    <form action="search.php" method="GET">
    <input type="text" name="search">
    <input type="submit" name="go" value="Search Website">
    </form>
    
  7. Done
    (replace yourwebsite.com with your actual website address above)

How to style the search results page

  1. Open thephpsearch_files/header.phpfile 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 displayabovethe search results into this file.
  4. Open thephpsearch_files/footer.phpfile 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 displaybelowthe 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 inphpsearch_files/phpsearch.cssto match the colours to your website design if the defaults do not work.
  10. Done.

Product Support

If you require assistance please feel free to use our support system by clicking herePlease do not post support requests on the item discussion board – these are not checked regularly and your question may go unanswered for weeks.

Download
Other components in this categoryAll components of this author
CommentsFrequently asked questions and answers

Properties

Created:
22 February 10

Last Update:
22 February 10

Compatible Browsers:
IE6, IE7, IE8, IE9, Firefox, Safari, Opera, Chrome

Software Version:
PHP 5.x, jQuery

Files Included:
HTML, CSS, PHP

Keywords

find website files, html search, php search script, search code, search form, search tool, searching, sitemap, static html search, website find, website search