Forum Moderators: phranque
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]
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.