SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Search Bar

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Search Bar

    Hi, I made a search bar in Photoshop are they a tutorial to get it to work in a website?

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Implementing your own search function is not a trivial exercise. It depends a lot on how your content is stored on the server. Is it static HTML files, or do you use a CMS that retrieves content from a database?

    You'll need a server-side script or program that accepts the query string from your search form and performs the search on your server. This server-side application will then format the results as a web page and return it.

    Unless you're an experienced developer, you'll probably be better off using an existing search function. Another option is to use a Google search, but Google's terms of service doesn't allow you to modify the appearance of the search for all that much.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Zealot Rexibit's Avatar
    Join Date
    Jul 2008
    Location
    United States
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can make a simple search function with JavaSript.

    <div id="searcharea">
    <h1>SEARCH</h1>
    <form name="search" action="search.htm">
    <input name="search" size="20" />
    <a href="javascript:document.search.submit()">GO</a>
    </form>
    </div>
    You could style this to fit your site's layout. If you wanted to use the function on another form you would change the "search" part of the javascript to whatever form you wanted. This just uses your browsers basic search feature.

    I agree AutisticCuckoo though that the best form of search would come from a script parsing your pages or database. It allows you a greater degree of control over how it is outputted.
    Rexibit Web Services
    Don't just build it - CSS it

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Rexibit View Post
    You can make a simple search function with JavaSript.
    That will only search within the current page, though, duplicating the search function that's already built into the browser.
    Birnam wood is come to Dunsinane

  5. #5
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Which is why I recommend people use Sphider if they need to incorporate a site search feature into their Web sites. (Though I tend to use WordPress almost exclusively these days as a CMS, so I don't have to worry about that.)


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
  •