Greetings.

First of all I'm a PHP bginner so take it easy on me :)

I'm trying to make a script that does the following:

* open a text file
* read its contents
* For each line on the file make a input tag with its contents, like
<input type="text" name="line1" value="foo is what we use to ask
questions. It doesn't really mean something.">
* Take the modified contents - modifyied in the input fields - and
update the text file

So, I've begun with:

1 <?php
2 $file = "news.txt";
3 fopen ($file, "r");
4 $fs = filesize ($file);
5 while (!feof($file))
6 {
7    $content = (fgets ($file, $fs));
8 }    
9 ?>

One thing I didn't understood is the length part of the fgets
command... Why use length with it? So, what I'm trying to do in lines
4 and 7 is to make sure it gets the contents by setting length = file
size... Am I right on this?

How do I split the contents of the file? Because I'm getting the
content of both lines in the $content variable...

I'm originally a Perl programmer so I know that the "split mark" must
be the end of line, but I'm really lost here.

Can someone help me?

Thanks in advance,


       Er Galvão Abbott
         Webdeveloper
  [EMAIL PROTECTED]
---------------------------------
To send me an e-mail just remove
the CAPITAL TEXT.
---------------------------------

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to