Need a little help

error or warning

Page 1 of 1

2 Replies - 1281 Views - Last Post: 01 July 2005 - 10:34 AM Rate Topic: -----

#1 souldude  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 30-June 05

Need a little help

Posted 30 June 2005 - 07:41 AM

hi folk

im new to this forum ang i wonder if i could get some help

my problem this error pops up
Warning: fread(): Length parameter must be greater than 0. in /home/djdeano/public_html/loginwarrior/admin/index.php on line 268


and the script is this that it is read from

<?php


$loadcontent = "../advanced_members/$u_name.txt";
if($save_file) {
$savecontent = stripslashes($savecontent);
$fp = @fopen($loadcontent, "w");
if ($fp) {
fwrite($fp, $savecontent);
fclose($fp);
print '<a href='.$_SERVER[PHP_SELF].'>Refresh</a>';
print "<html><head><META http-equiv=\"refresh\" content=\"0;URL=$_SERVER[PHP_SELF]\"></head><body>";

}
}
$fp = @fopen($loadcontent, "r");
$loadcontent = fread($fp, filesize($loadcontent));
$lines = explode("\n", $loadcontent);
$count = count($lines);
$loadcontent = htmlspecialchars($loadcontent);
fclose($fp);
for ($a = 1; $a < $count+1; $a++) {
$line .= "$a\n";
}

?> <center>
<form method=post action="index.php?userinfo=<?php echo "$u_id" ?>">
<input type="submit" name="save_file" value="Save">
<table width="90%" valign="top" border="0" cellspacing="1" cellpadding="1">
<tr>
<td width="3%" align="right" valign="top"><pre style="text-align: right; padding: 4px; overflow: auto; border: 0px groove; font-size: 12px" name="lines" cols="4" rows="<?=$count+3;?>"><?=$line;?></pre></td>

<td width="87%" align="center" valign="top"><textarea style="text-align: left; padding: 0px; overflow: auto; border: 3px groove; font-size: 12px" name="savecontent" cols="60" rows="10" wrap="OFF"><?=$loadcontent?></textarea></td>
</tr>
</table>

<br>

</form>

The refered to error is in purple ..
any help to recitfy this will be greatfull

souldude

Is This A Good Question/Topic? 0
  • +

Replies To: Need a little help

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 247
  • View blog
  • Posts: 13,505
  • Joined: 12-July 02

Re: Need a little help

Posted 01 July 2005 - 09:51 AM

The error is noting that the length of the file returned by your call to filesize is zero...this means either the file may not exist, or has nothing in it.
Was This Post Helpful? 0
  • +
  • -

#3 souldude  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 30-June 05

Re: Need a little help

Posted 01 July 2005 - 10:34 AM

ok thanks


i'm new to all this .
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1