Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I search my own site

Status
Not open for further replies.

bhogaj31

IS-IT--Management
Mar 11, 2003
114
0
0
GB
Hi all,

Can somebody please advise me how I add a search button to my website, which only searches my website for information.

I don't want any advertising from other providers of search facilities.

All help much appreciated.

Thanks in advance.

Bhogaj31
 
Hi

You can use Google. Of course, if your site is already indexed by Google.
Code:
<form action="[URL unfurl="true"]http://google.com/search"[/URL] method="get">
<input type="hidden" name="as_sitesearch" value="[red]example.com[/red]">
<input type="text" name="q">
<input type="submit" value="Search my site">

Feherke.
 
Is your website stored in a database and delivered dynamically when it is requested by the user? If so... then adding a search facility is as simple as searching some fields in the database (some minor modification to the table definition and a page to handle the results... you are away).

If your site isn't backended with a database, then you might want to look at some other means to build up a list of keywords (maybe manually parsing the whole site through some code that stores unique words etc). You would still need to develop a results page... of course.

Some important questions that need answering first: what server-side environment are you using (PHP or just plain HTML)? What database back-end are you using (mySQL, SQL, Access, none)? What budget do you have (or ar you attempting to do this for nothin')?

There is no "off the shelf" solution that would work generically in every scenario.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
I think you've basically got three options:
[ul]
[li]Use a free third party search solution like the Google code Feherke's already posted, or . Search results are displayed on a third party site, which may make it difficult to fully integrate them into your pages. The results posted will also usually have adverts with them - that's how the search providers pay their bills without charging you. At least if you go the Google route you can use Adsense for Search to snaffle a slice of the ad revenue.
[/li]
[li]Pay for a third party solution - many of the free services have a "professional" option which mean you don't get ads, and may be able to customisse your result pages a bit more too.
[/li]
[li]Run a search script on your server to keep it all in-house. This is more work, but obviously you can tweak it to fit your exact requirements. Just pick a language and a budget that suits you, a good place to start looking for ready-made scripts is [/li][/ul]
As Jeff says, a bit more information might yield you more specific advice.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top