Results 1 to 6 of 6

Thread: Adding search function to Website

  1. #1
    Join Date
    Dec 2009
    Posts
    71

    Adding search function to Website

    Hello Friends !!!
    I want to create a search function , in my website just using a string of code. I don't need anything from or on the server? It should be such that if someone types in the textbox and click the search must result in a page that shows keywords and articles from the website? Also provide me the code if possible?
    Last edited by Gannon; 18-12-2009 at 09:59 PM.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Adding search function to Website

    As far as the search code is concerned is concerned it is almost impossible to write it without using something on the server side, you could only write a java or a Javascript search. Moving on to the browsers compatibility the JavaScript searches can be limited, and also if you are using javascript you are on the verge of taking the age-old risk of crashing browsers and Operating Systems.

    Here is a mixed form of code i took it from the scriptsearch.com ,however this site don't seems to monitor the submissions very well

    Java: scriptsearch.internet.com/pages/l18c3c45.shtml

    javascript: scriptsearch.internet.com/pages/l4c3c45.shtml

    You can get it from these links

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Adding search function to Website

    The following segment of code may help you , I am also new to HTML ,But somehow managed to get these codes nut I am trying to make this code functional. So if you can make this function working please let me know
    Here is the code
    <FORM NAME="Search" METHOD="GET" ACTION="http://websitethere/search/">
    <B>Search this library</B>&nbsp;
    <select name="searchscope" >
    <option value="1"> Library a</option> <option value="2"> Library 2</option> <option value="3"> Library b</option> <option value="4"> Library 4</option> <option value="5" selected="selected"> Library 6</option> </select>

    <BR>
    <B>by:</B>
    <SELECT NAME="searchtype" onChange="Oink(this.form)">
    <OPTION VALUE="a">Author&nbsp;</OPTION>
    <OPTION VALUE="t">Title&nbsp;</OPTION>
    <OPTION VALUE="q">Author&nbsp;/&nbsp;Title&nbsp;</OPTION>
    <OPTION VALUE="s">Journal&nbsp;Title&nbsp;</OPTION>
    <OPTION VALUE="X" SELECTED>Words&nbsp;</OPTION>
    <OPTION VALUE="c">NLM&nbsp;Call&nbsp;Number&nbsp;</OPTION>
    <OPTION VALUE="j">Subject&nbsp;-&nbsp;MeSH&nbsp;</OPTION>
    <OPTION VALUE="d">Subject&nbsp;-&nbsp;Library&nbsp;of&nbsp;Congress&nbsp;</OPTION>
    <OPTION VALUE="g">Government&nbsp;Document&nbsp;(SuDOC&nbsp;#)&nbsp;</OPTION>
    </SELECT>
    <BR>
    <B>for:</B>
    <INPUT TYPE="TEXT" NAME="searcharg" SIZE="40" MAXLENGTH="75">
    &nbsp;&nbsp;
    <INPUT TYPE="SUBMIT" VALUE="Search">
    <BR>
    </FORM>

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: Adding search function to Website

    The basic logic required here is to be able to manipulate one of the variables which the Google search engine handles , called as sitesearch. Setthis variable to a null value and you're searching the entire World Wide Web, But if you specify or set its domain it will function as if you had typed in the Google special notation site:domain.

    You will just need an input textfield and a corresponding submit button.

    <form method="get" action="http://www.google.com/search">
    <input type="text" name="q" size="35"
    maxlength="255" value="" />
    <input type="submit" value="Google Search" />
    <input type="radio" name="sitesearch" value="" />
    The Web
    <input type="radio" name="sitesearch"
    value="sitename.com" checked /> Ask Your Site<br />
    </form>

  5. #5
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Adding search function to Website

    The basic logic required here is to be able to manipulate one of the variables which the Google search engine handles , called as sitesearch. Setthis variable to a null value and you're searching the entire World Wide Web, But if you specify or set its domain it will function as if you had typed in the Google special notation site:domain.

    You will just need an input textfield and a corresponding submit button.

    HTML Code:
    <form method="get" action="http://www.google.com/search">
    <input type="text"   name="q" size="31"
     maxlength="255" value="" />
    <input type="submit" value="Google Search" />
    <input type="radio"  name="sitesearch" value="" />
     The Web
    <input type="radio"  name="sitesearch"
     value="sitename.com" checked /> Ask Dave Taylor<br />
    </form>

  6. #6
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Adding search function to Website

    I was also looking for the same type of code but I got it from one of the internet sites so here is the code for you use it and enjoy

    HTML Code:
    <form method="get" action="http://www.google.com/search">
    <div style="border:2px solid black;padding:5px;width:20em;">
    <table border="0" cellpadding="0">
    <tr><td>
    <input type="text"   name="q" size="25"
     maxlength="255" value="" />
    <input type="submit" value="Google Search" /></td></tr>
    <tr><td align="center" style="font-size:75%">
    <input type="checkbox"  name="sitesearch"
     value="yousitesname.com" checked /> only search Ask Dave Taylor<br />
    </td></tr></table>
    </div>
    
    </form>

Similar Threads

  1. Quick search Function in Opera with different Search engines?
    By Oorja in forum Technology & Internet
    Replies: 2
    Last Post: 23-02-2012, 05:53 PM
  2. Need help with the adding new search provider in IE 10 in windows 8
    By Soumodip in forum Technology & Internet
    Replies: 3
    Last Post: 08-12-2011, 10:27 PM
  3. Function search in a string
    By Amandev in forum Software Development
    Replies: 3
    Last Post: 24-11-2009, 02:19 PM
  4. Adding RSS feeds to a website using Carp
    By Aaliyah in forum Software Development
    Replies: 3
    Last Post: 24-11-2009, 10:30 AM
  5. capturing video and adding it to a website
    By nkc in forum Windows Software
    Replies: 3
    Last Post: 03-07-2009, 08:45 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,316,754.53471 seconds with 17 queries