Jump to content

txt file search program needed


Flustered

Recommended Posts

For the webmasters working with this script...Do you know a solution for next "problem"?

 

My text file contains something like this (example is just a copy from Wikipedia):

 

Line (geometry), an infinitely-extending one-dimensional figure that has no curvature

a length of rope, cable or chain when put to use (such as a clothesline, anchor line)

a line or queue of people waiting in a queue area

a line of text in writing

 

When I search for 'figure', I get 'Line (geometry), an infinitely-extending one-dimensional figure that has no curvature' (cool!)

 

When I search for 'that has no curvature', I get 'Line (geometry), an infinitely-extending one-dimensional figure that has no curvature' (cool!)

 

BUT when I search for 'figure curvature', I get NOTHING. So this script is search for the exact match.

 

Is there a way to tell this script to show the lines with 'figure' and 'curvature' in the same line?

Link to comment
Share on other sites

If you're using this version here

Then enter each word to search for on a separate line.

Yes, I'm using that version. But now I understand why I didn't understand that part of search:

- When you have let's say 10 lines with 'figure' and 'curvature' not all words get a red or blue color (when on the same line, in some cases only one word gets a color).

- Because I'm using GET (and not POST) I see an url like .../search.php?keyword=figure%0D%0Acurvature&submit=Search. I expected '+'.

 

I have tested out alot of search-in-files-script, but this is the best: simple to use, great options, and no database required :D

 

Some technical questions for coders:

1. How do you convert '%0D%0A' to '+' in the url?

2. I'm trying to include the result in a page in a local format

<?php include "/home/account/domains/domain.com/public_html/search.php?keyword=garden&submit=Search"; ?>

but this is not working, so now I'm using fopen to reach the same result. But I have to use 'http'. Is there a solution for this?

3. is it possible to remove '&submit=Search' from the output url?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.