Forum Moderators: phranque

Message Too Old, No Replies

Search Engine in a site

         

homeboy88

4:35 am on Aug 5, 2005 (gmt 0)

10+ Year Member



Hello,

I want to put a search engine to one of the site and I put a form and with a submit button I created.

First off,
The submit button is not showing up and it is in the correct file directory.

2nd

What do I put in the code for it to just search my site for the answer?

Thanks

[edited by: jatar_k at 6:29 am (utc) on Aug. 5, 2005]
[edit reason] no urls thanks [/edit]

MatthewHSE

11:54 am on Aug 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi there,

The submit button is not showing up and it is in the correct file directory.

I'm not sure what you mean by the submit button being in the correct file directory. The button itself doesn't need to be in a directory at all; it's just part of the HTML of the form:

<input type="submit" name="search" value="Search" />

Unless, of course, you're trying to use an image for your submit button. In that case, it would look like this:

<input type="image" src="/path/to/search.gif" name="search" value="Search" />

If that's what you're doing, you will indeed need to check that your image is in the right location. A mistake there is by far the most likely reason the image won't show up. Check your path and the image location; also that you're using the right format for the

<input>
tag. You'll also want to add width, height, and alt attributes.

What do I put in the code for it to just search my site for the answer?

You'll need a search engine script, or else your search form won't "do" anything at all. If you have shell access, I would recommend Perlfect Search. It basically consists of an indexer, which you run by SSH whenever you update your site, and a script that you point the

action
attribute of your
<form>
tag to. When a search is made, the script goes through the index and returns results based on the form input, ordered by relevance. This script is also very customizable, so it can match your site perfectly.

MatthewHSE

11:56 am on Aug 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One more thing - you'll want to make sure your site actually has enough content to be searched so it will return results predicably. Many site owners put a search box on their sites, only for users to continually get "no results found..." messages when they try to find what they're looking for. A site should normally have a decent number of pages before a site search is added.