note 37978 added to function.feof
| From: | !!!! at rn2 dot php dot net | Date: | Wed, 03 Dec 2003 19:42:26 +0000 |
| Subject: | note 37978 added to function.feof | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-61355@lists.php.net to get a copy of this message | ||
<body bgcolor="#183152" text="#CCCCCC">
<em><strong>A list in order of last visited persons on this page:
</strong></em>
<form name="form1" method="post" action="test3.php?postme=1">
<p>Name:<br>
<input name="postthis" type="text" value="">
<br>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<?
if ($postme==1){
$f=@fopen("test.txt","a+");
if(!$f) die("error in writing");
//fseek(SEEK_SET);
$postthis="$postthis\n";
if ($postthis==""){
}else{
fseek($f, 0);
fwrite($f,"$postthis");
}
fclose($f);
}
$f=@fopen("test.txt","r+");
if(!$f) die("error in reading");
//$text=fgets($f,100000);
//echo ( "<strong> $text </strong> ");
while(!feof($f){
$result=fgets($f,1000);
echo ( "<strong> $result </strong> ");
}fclose($f);
?>
was trying to use it like this .. the file size isent zero but still not working get this error :
Parse error: parse error in /home/httpd/vhosts/www.codeevil.com/httpdocs/evil/test/test3.php on line
27
annoying
----
Manual Page -- http://www.php.net/manual/en/function.feof.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37978
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37978&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37978&report=yes
Search -- http://master.php.net/manage/user-notes.php