Link to home
Start Free TrialLog in
Avatar of TanyaG
TanyaG

asked on

search a .txt file and return results in HTML

If i have 2 text boxes and a button and a text file... How do I use the text entered in the first text box to search the .txt file and return the results into the second text box?  

Can I do this WITHOUT asp ?

thanks!
tanyag
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Can you do it without asp sure, but yu are going to have to have some kind of scripting language on the server.  An HTML page cannot access files.  You have to have some kind of search script.

Cd&
Avatar of vdhant
vdhant

Do you want to find the file on the server or on the client???
ant
If the file is not very big in size you can get if from the server when the page is being loaded, then you can make a javascript function that can search for the Text in the file without making a server call.

CodingExperts
Avatar of TanyaG

ASKER

Thanks!

What I would like to do is some sort of javascript function for the search button, like OnClick .. but can anyone supply some sort of code.. And can I use SQL in there or something? Like.. OnClick take the text from textbox1 and search .txt file for works LIKE the textbox1 and display in textbox2 (the entire string..)


TanyaG
Avatar of TanyaG

ASKER

BTW, this is just 1 text file and 1 html file. The text file contains a bunch of different books...
Avatar of TanyaG

ASKER

Is this valid?

SELECT ALL from books.txt ?
1. You need to use a database to do the SELECT ALL query. query.txt is just a text file.

2. I don't know if you can connect from a client (like javascript), all the way to your server which has the text file. It would be much easier if you can set up something like php or asp to read the text file and return the results.

Abhishek (AJ) Ratani
Avatar of TanyaG

ASKER

Do you know of any BASIC asp tutorials or examples I can look at?  I really don't know how to program in asp..
PHP is the easiest to install and use and its free and there are so many tutorials available,

http://www.php.net

AJ
i ask my question again Do you want to find the file on the server or on the client???

Also how is IIS hard to install you put your window cd into the computer, you dont even need to use the internet.
ant
ASKER CERTIFIED SOLUTION
Avatar of pmsyyz
pmsyyz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial