Closed Thread
Results 1 to 4 of 4

Thread: Site Search

  1. #1
    samo1215 is offline Newbie
    Join Date
    Jun 2009
    Posts
    3
    Rep Power
    0

    Site Search

    I am building a new website and want to add search to the site. I know google offers free and paid solutions but I would prefer to develop something myself if possible. How difficult and what steps would I need to take to put something together?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: Site Search

    Is the site flat html? No php or anything? I would simply put all the pages into a database and just make that searchable.

    Can we see your site? I am sure we can help you.

  4. #3
    samo1215 is offline Newbie
    Join Date
    Jun 2009
    Posts
    3
    Rep Power
    0

    Re: Site Search

    I haven't put the site online yet otherwise I'd post a url. Currently, I have only used html, css and some javascript. I don't know much php but was considering using php includes for repeated elements like the header, navigation and footer.

    Unfortunately I don't currently know how to put my entire site in a database. If the learning curve for the php/mysql isn't too bad I welcome any suggestions, links or other references I could use. Thanks for your help.

  5. #4
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: Site Search

    Just making the content searchable shouldnt be hard to learn.

    Do you have phpmyadmin?

    One method would be to make a table with any name you like really id probably use something like "content" or something.

    Id probably put something like "id", "title", "url", "content"

    then just use phpmyadmin to put it in there

    I will assume you can make a form that sends get data?

    then using that post data do something like:

    Code:
    $q explode(' '$_GET['q']);
    foreach(
    $q as $word) {
        
    $q2 .= " `content` LIKE '%{$word}%' OR";
    }
    $query mysql_query("SELECT title, url FROM `content` WHERE ".substr($q20, -3));
    while(
    $row=mysql_fetch_assoc($query)) {
        echo 
    '<a href="'.$row[url].'">'.$row[title].'</a><br />';


Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Search Engine && Search Algorithm (Help)
    By pally98 in forum General Programming
    Replies: 2
    Last Post: 10-03-2011, 10:49 AM
  2. Replies: 4
    Last Post: 09-15-2010, 06:19 AM
  3. Replies: 1
    Last Post: 03-18-2010, 10:15 AM
  4. Automatical Site Search Based On (Sub)Folders Name
    By PTaab in forum General Programming
    Replies: 12
    Last Post: 11-27-2009, 11:50 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