1
   

search code

 
 
husker
 
Reply Fri 12 Sep, 2003 11:54 am
looking for the html or cgi to place on a website to search a site for specific information.
for example I wanted to search a2k for Monger and see all the results.
Laughing
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 1,152 • Replies: 7
No top replies

 
Craven de Kere
 
  1  
Reply Fri 12 Sep, 2003 12:13 pm
Ok, first of all you need to understand how search engines work.

There are basically two ways to accomplish what you want. One is to use a script that will spyder the pages you define right after you enter the search query. This would tpically be done with a java applet but if you want to search all of Able2Know there are several million links and it would take a long long time.

And it'd crash your browser.

So you'd need to search a database that has spidered the pages prior to the search.

For that you need to either make a spider, pay for a spider, use a free spider (usually limited to a few thousand pages), or simply use an existing search database.

The last option is easy. Just use Google's search box. Of course if the site is not indexed in Google it won't help you.

Code:<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<TABLE bgcolor="#FFFFFF"><tr><td>
<A HREF="http://www.google.com/">
<IMG SRC="http://www.google.com/logos/Logo_40wht.gif"
border="0" ALT="Google" width="128" height="53"></A>
</td>
<td>
<INPUT TYPE=text name=q size=31 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="Google Search">
<font size=-1>
<input type=hidden name=domains value="able2know.com"><br><input type=radio name=sitesearch value=""> WWW <input type=radio name=sitesearch value="able2know.com" checked> www.Able2Know.com <br>
</font>
</td></tr></TABLE>
</FORM>
<!-- SiteSearch Google -->


Replace Able2Know with the domain you want to search.
0 Replies
 
Monger
 
  1  
Reply Sat 13 Sep, 2003 01:19 am
Here's some short code I wrote for me own site that does the same thing.
Code:<form name="form1" action="javascript:window.document.location.href=('http://www.google.com/search?q=site:www.able2know.com+'+document.form1.search1.value);">
<input type="text" name="search1">
<input type="Submit" value="Search">
</form>


Again, replace able2know with whatever domain you wanna search.
0 Replies
 
CodeBorg
 
  1  
Reply Sat 13 Sep, 2003 01:46 am
Husker, do you mean to
a) embed a search done with google, with results shown at google,
b) create your own search engine database, with results shown by your server,
c) perform a search using google, with XML results parsed and displayed by your server,
d) or just jumping to another sites search results?
(For instance, click here to search A2K for everything Monger has said about Linux.)


Without XML, if you want your server to collect and format the search results from another website's search engine, you might use something like WinHTTP to fetch the page, then parse it into whatever data you need. A little harder than XML but not much.

PS -- Craven, does phpBB support XML search results? Don't see any embedded, but who knows.
0 Replies
 
Craven de Kere
 
  1  
Reply Sat 13 Sep, 2003 02:27 am
I really don't recommend spidering other people's pages with a tool you are unfamiliar with though. To give an example, just Google's spiders themselves use over 30 gigabytes of bandwidth a month. If this wasn;t google but some Huskerbot I'd not really want that server load and bandwith.

So just be careful what you use. A well written spider takes server resources into mind and will not down a server.

The easiest solution would be to use a remotely hosted "site search" feature and it will spider a medium sized site for you.

If you pay you can spider more pages but it might be against their TOS to spider sites you don't own.

To put together a site search of a site you own you can use a script that will index your pages. Typically it will run on a cron job and index all your files.

Note that this is a solution for flat files and database data might need a custom solution to search.

Another option if you are dealing with few pages is to manually index them. It's not worth doing for more than a few pages though.

Cb,

Nah, it would need a modification to do so. Probably exists. I might look into it.
0 Replies
 
husker
 
  1  
Reply Sun 14 Sep, 2003 12:26 pm
the google one seems to be working out ok
0 Replies
 
husker
 
  1  
Reply Sun 14 Sep, 2003 12:28 pm
Code:> <center>
> <FORM method=GET action=http://www.google.com/custom>
> <!--mstheme--></font><TABLE bgcolor=#FFFFFF cellspacing=0 border=0>
> <tr valign=top><td><!--mstheme--><font face="Times New Roman">
> <A HREF=http://www.google.com/search>
> <IMG SRC=http://www.google.com/logos/Logo_25wht.gif border=0 ALT=Google
> align=middle width="75" height="32"></A> <!--mstheme--></font></td></tr>
> <tr><td><!--mstheme--><font face="Times New Roman">
> <INPUT TYPE=text name=q size=19 maxlength=255 value="">
> <INPUT type=submit name=sa VALUE="Search">
> <INPUT type=hidden name=cof
>
VALUE="T:#000000;LW:600;ALC:#CC9933;L:http://www.hoagiesgifted.org/images/ho
agie
>
sheader.jpg;LC:#333399;LH:60;BGC:#FFFFFF;AH:center;VLC:#336666;GL:0;S:http:/
/www
> .hoagiesgifted.org;AWFID:a7bf96bb6f4b19d2;">
> <font face=arial,sans-serif size=-1><input type=hidden name=domains
> value="www.hoagiesgifted.org"><br><input type=radio name=sitesearch
> value="www.hoagiesgifted.org" checked>
> Hoagies <input type=radio name=sitesearch value=""> WWW </font>
> <br>
> <!--mstheme--></font></td></tr></TABLE><!--mstheme--><font face="Times
New
> Roman">
> </FORM>
> </center>
0 Replies
 
Monger
 
  1  
Reply Sun 14 Sep, 2003 12:56 pm
Well, if you want search that advertises hoagiesgifted with a massive banner that's the code to use.

For anyone who wants to customize google search for their own site just fill out the form here & it'll generate the code for you: Customizable Google Free Search
0 Replies
 
 

Related Topics

Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » search code
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.05 seconds on 01/16/2025 at 01:06:11