Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2004
    Posts
    185
    Thanks
    2
    Thanked 1 Time in 1 Post

    basic (small-scale) search

    without using indexes or involving other technologies, is there a 'better' way to slog through pages looking for keywords? right now i loop through root, open all the text files (as determined by checking filename against an array of 'ok' extensions) with file_get_contents and check for the search term with strpos. each of the subdirs calls the same function on itself. results echoed as links.

  • #2
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    For a file based system, this is really the only way and I would HIGHLY reccomend devising some kind of indexing system. Personally, I would rather use MySQL database which would allow you to perform fast searches... If you are planning on expanding your web page I would reccomend that you try and make use of MySQL (assuming you have it available).

    If you don't have MySQL at your disposal I would try and create some kind of custom index. As it sounds like you dont have *alot* I would possibly use arrays and store the keywords that way.

  • #3
    Regular Coder
    Join Date
    Jan 2004
    Posts
    185
    Thanks
    2
    Thanked 1 Time in 1 Post
    gracias


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •