Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1
    Senior Member
    Join Date
    Oct 2007
    Posts
    241
    Member #
    15910
    Is anybody able to tell me how can I make a search box for searching the html content of my website? Also I have many htm files, I want them searched too...

    Or, should I just paste one from yahoo or google and that woudl solve the problem? (I mean are they for searching the html of MY site or the whole web?)

    Lastly, I already have a search box for searching the data in my mysql databases. Is there a way to have a combined searchbox that is able to seach both the htm, html and mysql portions of my website?

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,720
    Member #
    5580
    Liked
    718 times
    Usually, the HTML page is generated from a database.
    So searching the HTML is not necessary. But you must have
    some static web pages?


  4. #3
    Senior Member imagn's Avatar
    Join Date
    Jul 2007
    Location
    Los Angeles
    Posts
    156
    Member #
    15594
    You can PHP's CURL to "read" your static pages and then run regular expression to search for whatever your visitors entered.

    Have you looked into adding Google search? The free version displays the small ads and there is a cheap paid version ($100/year) that omits them.

  5. #4
    Senior Member Dorky's Avatar
    Join Date
    Jun 2009
    Location
    Destin Florida
    Posts
    1,430
    Member #
    19103
    Liked
    4 times
    hey i was just thinking about the google search tool imagn. thx for the info

    while($get_it !== true){ continue; }

  6. #5
    Senior Member
    Join Date
    Oct 2007
    Posts
    241
    Member #
    15910
    well, yes I might have some static pages, because for one page, the content will vary greatly in format from one week to another, so if I use php i will be stuck with just one format, though it will be automatic. so thats why i wanted to see how can i search static pages as well.

  7. #6
    Senior Member Dorky's Avatar
    Join Date
    Jun 2009
    Location
    Destin Florida
    Posts
    1,430
    Member #
    19103
    Liked
    4 times
    nono you can use conditional php (if) statements for entire divs or an entire layout for that matter.

    while($get_it !== true){ continue; }

  8. #7
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,720
    Member #
    5580
    Liked
    718 times
    Let's say you search for a word somewhere within your HTML pages.
    Example, the word "photograph" ...
    What happens when it finds that word in your HTML?

    Does it display the whole page?
    Does it display the line where it was found?

    That's the problem with searching your HTML ...
    What will you do with your result(s) ... and what if you have 50 results from 3 pages?


  9. #8
    Senior Member imagn's Avatar
    Join Date
    Jul 2007
    Location
    Los Angeles
    Posts
    156
    Member #
    15594
    You would use the array functions to combine same-page hits and just display a list of those returned. You could even add a psuedo-relevancy score by the number of hits on a given page. Once you're on the page you can also use a reg exp to highlight the word(s) a user looked for.

    It can be a bit of a pain which is why I still say Google

  10. #9
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,720
    Member #
    5580
    Liked
    718 times
    Trace ...
    Not sure what that means.

    You mean searching for HTML tags, like <div> and <body> and <img src>?
    Or text between tags? HTML really has nothing worth searching.


  11. #10
    Junior Member drwatz0n's Avatar
    Join Date
    Jun 2009
    Location
    New York, USA
    Posts
    2
    Member #
    19235
    Quote Originally Posted by Dorky
    nono you can use conditional php (if) statements for entire divs or an entire layout for that matter.
    Well, he could do that, but it would require some modification to his site. As of now, all he would like to do is integrate some sort of search system.

    Would it be possible to create your own list of search "terms", and once the search is performed, return a list of articles/content relating to the term? If your page contains a lot of static HTML pages, then I would assume you have some sort of understanding/naming scheme for the pages (say "may_photos", or "fall_photos"). For example, searching "photos" would return a list of all of your static pages that fit with "photos".

    The upside to this is that you don't need to search every single page of your site, or convert it to some sort of heavily-PHP based system, which isn't something you have now (from what I was able to garner). The downside is that you must define each of the results returned for each query. Once it's set up, it should be fairly easy to maintain, but, depending on the size of your site, may take some time to set up fully.


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:24 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com