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
TanyaGAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

COBOLdinosaurCommented:
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&
0
vdhantCommented:
Do you want to find the file on the server or on the client???
ant
0
CodingExpertsCommented:
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
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

TanyaGAuthor Commented:
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
0
TanyaGAuthor Commented:
BTW, this is just 1 text file and 1 html file. The text file contains a bunch of different books...
0
TanyaGAuthor Commented:
Is this valid?

SELECT ALL from books.txt ?
0
arataniCommented:
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
0
TanyaGAuthor Commented:
Do you know of any BASIC asp tutorials or examples I can look at?  I really don't know how to program in asp..
0
arataniCommented:
PHP is the easiest to install and use and its free and there are so many tutorials available,

http://www.php.net

AJ
0
vdhantCommented:
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
0
pmsyyzCommented:
Yes, use JavaScript to load a text file from the same server as the HTML file is on.

var req;

function loadXMLDoc(url) {
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChange;
        req.open("GET", url, true);
        req.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChange;
            req.open("GET", url, true);
            req.send();

        }
    }
}

// handle onreadystatechange event of req object
function processReqChange() {
    // only if req shows "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            processtext();
         } else {
            alert("There was a problem retrieving the XML data:\n" +
                req.statusText);
         }
    }
}


function processtext()
{
   .... do whatever...
}

document.onload = loadXMLDoc("DVDs.txt");


XMLHttpRequest is cool.  It is what Google uses to make Gmail so quick and responsive.

See http://developer.apple.com/internet/webcontent/xmlhttpreq.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.