Hello I need the html code for a search box that will search for keyword and content in my site. Thanks
<input type="text" /> is the HTML code for the box as requested To actually perform the search you need serverside setup such as .Net or PHP or plug into the Google API or equiv
i know what you are looking for Try FreeFind.Com and it works fine.. I am using it on my site also.. It crawls your site whenever you want to update search results..kind of your own search engine,,
How about that? Copy/paste the following source code into a notepad and save it as an html file. Open it on explorer. Simple, easy to use "search my site" system using google and pure html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <!-- SiteSearch Google --> <form method="get" action="http://www.google.com/custom" target="_top"> <table border="0" bgcolor="#ffffff"> <tr><td nowrap="nowrap" valign="top" align="left" height="32"></td> <td nowrap="nowrap"> <input type="hidden" name="domains" value="mysite.com"></input> <label for="sbi" style="display: none">Enter your search terms</label> <input type="text" name="q" size="31" maxlength="255" value="" id="sbi"></input> <label for="sbb" style="display: none">Submit search form</label> <input type="submit" name="sa" value="Search" id="sbb"></input> </td></tr> <tr> <td> </td> <td nowrap="nowrap"> <table> <tr> <td> <td> <input type="hidden" name="sitesearch" value="mysite.com" id="ss1"></input> </tr> </table> <input type="hidden" name="forid" value="1"></input> <input type="hidden" name="ie" value="UTF-8"></input> <input type="hidden" name="oe" value="UTF-8"></input> <input type="hidden" name="hl" value="en"></input> </td></tr></table> </form> <!-- SiteSearch Google --> </body> </html> Code (markup):
<SCRIPT language=JavaScript> var NS4 = (document.layers); var IE4 = (document.all); var win = window; var n = 0; function findInPage(str) { var txt, i, found; if (str == "") return false; if (NS4) { if (!win.find(str)) while(win.find(str, false, true)) n++; else n++; if (n == 0) alert("Not found."); } if (IE4) { txt = win.document.body.createTextRange(); for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { txt.moveStart("character", 1); txt.moveEnd("textedit"); } if (found) { txt.moveStart("character", -1); txt.findText(str); txt.select(); txt.scrollIntoView(); n++; } else { if (n > 0) { n = 0; findInPage(str); } else alert("Sorry, we couldn't find.Try again"); } } return false; } </SCRIPT> Try this it will help you