Results 1 to 2 of 2

Thread: php search engine

  1. #1
    Join Date
    Nov 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post php search engine

    hello all, does anyone know of a good php search engine script that will search files on my server from there meta tag.
    or any anything else.
    thanks

    -peej

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,162
    Thanks
    263
    Thanked 690 Times in 678 Posts

    Default

    Hm... interesting. I could write that now. But I'm not going to because it would be silly.

    It takes a while to search through all of that.

    You could:
    1. Do a directory listing type search.
    2. Store each .htm (etc) file you come across with file_get_contents();
    3. Split at the meta tag.
    4. Save the metas and filenames/paths in an array.
    5. Use a foreach loop to run through the array, using strpos() to determine if the search string does exist*
    (*this assumes a single word; you could do more complex looping if need be)
    6. Save each match into a new array, including the filename/path.
    7. Output the matches' filenames/paths.

    But it would take a while.

    The better idea is to do the same, but use a database to seed the webpage list (skipping to step 5).
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •