View Single Post
Old 08-23-2005, 12:26 PM   #7 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,720
redhead is on a distinguished road
Code:
$fp=fopen($file_name, "a+");
fseek($fp, SEEK_SET);
while($str=fgets($fp))
  echo $str ."<br>";
fseek($fp, SEEK_SET);
fwrite($fp, $some_text, strlen($some_text));
fclose($fp);
But I don't see why you want to write to a file while opening it for displaying in your window, usualy you let the user see the file, make changes to it, and then uppon submitting the changes you open the file and rewrite it with the contence the user changed it to.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote