Re: Php warning message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>
> *$boardFile = "MessageBoard.txt";
> $boardFileHandle = fopen($boardFile,"r");
> for ($counter = 1; !feof($boardFileHandle); $counter += 1) {
>  $colorLine = fgets(boardFilehandle);
>  if ($counter % 2 == 0) {
>  echo "<font color='00ff00'>$colorline</font>";
>  } else {
>  echo $colorline;
>  }
> }
> fclose($boardFileHandle);*


 Looks like you're missing a $ on line 4:
 $colorLine = fgets(boardFilehandle);

Should be
 $colorLine = fgets($boardFilehandle);

[snip]
I may be showing my ignorance here... But on your if ($counter % 2
==0) line what does the "%" do? Was that possibly a typo?
[/snip]

It's the modulus operator; he's trying to make every other line a different
color. :)

-- Greg

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux