in reply to Need help with searching flatfile and updating it.

The bigger problems you have with re-inventing wheels that should not be reinvented notwithstanding, your main problem is the fundamentally broken loop that is looking at the data that came from the file. Without resorting to rewriting code for you, in english your program does this:

In a nutshell, this means that the browser that matches the form entry gets printed to the log, while the others get printed to the browser. I bet if you looked at the logfile, you would find it always contains at most 1 line.

There are however, several other problems with this code:


We're not surrounded, we're in a target-rich environment!
  • Comment on Re: Need help with searching flatfile and updating it.

Replies are listed 'Best First'.
Re^2: Need help with searching flatfile and updating it.
by chas (Priest) on Apr 25, 2005 at 04:03 UTC
    "In a nutshell, this means that the browser that matches the form entry gets printed to the log, while the others get printed to the browser."
    I forgot to remark on that in my reply, but I didn't undertand the point of that print either. In fact, it isn't even being printed to the browser I think, because the print "Content-type: text/html\n\n"; doesn't occur till later.
    chas