search function

Discussion in 'PHP' started by johny321, Jun 9, 2009.

  1. #1
    How we can put search box in static site & do search
     
    johny321, Jun 9, 2009 IP
  2. wwwbryan

    wwwbryan Well-Known Member

    Messages:
    181
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    #2
    You can't. You need some kind of back end to generate the search results.

    You could use a free service, but it won't be on your website.
     
    wwwbryan, Jun 9, 2009 IP
  3. givemeknol

    givemeknol Active Member

    Messages:
    22
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    88
    #3
    Could you use Google custom search ?
     
    givemeknol, Jun 9, 2009 IP
  4. SHOwnsYou

    SHOwnsYou Peon

    Messages:
    209
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can create a hack for it, it just won't be pretty.

    Have a search form. Let the action be results.php (that part will need to be dynamic). In results.php, do something like this:
    
    $q = $_GET['inputname'];
    
    if (eregi($q, SOME TITLE OR TERM))
    {
    echo "<a href='linkhere.html'>LinkName</a>";
    }
    
    etc, etc, etc for each of your pages.
    
    PHP:
    It will work, but will be very time consuming.
     
    SHOwnsYou, Jun 9, 2009 IP
  5. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #5
    Social.Network, Jun 9, 2009 IP
  6. ezprint2008

    ezprint2008 Well-Known Member

    Messages:
    611
    Likes Received:
    15
    Best Answers:
    2
    Trophy Points:
    140
    Digital Goods:
    1
    #6
    Google custom search is the best option - it works and looks decent since people are probably used to Google search results
     
    ezprint2008, Jun 10, 2009 IP