|
Posted by Michael Vilain on 06/05/05 12:54
In article <pan.2005.06.05.02.34.13.960281@nowhere.com>,
Konan <knnanxxxx@nowhere.com> wrote:
> Pardon the simple question, but I have just begun to learn PHP. So far so
> good - all the examples in my books actually work.
>
> One thing that none of them address is how to read a file of strings (like
> names or URLs or whatever) into something so that they can be deleted,
> modified or a new one added. In a language like Perl/TK or Delphi a
> listbox is used if you want to edit line by line or a memo box if you want
> to edit like you are in Kwrite.
>
> All the examples assume that I want to enter data into a Text area or
> Listbox by keyboard, then read it back in. Never the other way around. I
> can use a Fget routine and read the file to the screen, but not to
> anything in which I can edit yet.
>
> So far I have learned a ton of stuff trying, but haven't made it work yet.
>
> Should I be reading the data into a Textarea, a Listbox or something else?
>
> Anybody got a short example.
>
> Thanks
> Konan
You have a file consisting of lines of text. fgets(HANDLE) will return
a line at a time into a variable. So you use it within a loop and store
into an array. Now you have an array who's elements contain the lines
of your file. You can do whatever you want to the that array with the
various array manipulation functions and output whatever you wish in
HTML.
What's the problem you're trying to solve? I'm confused here.
--
DeeDee, don't press that button! DeeDee! NO! Dee...
[Back to original message]
|