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?

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.