Re: Fwrite Function
| From: | Richard Lynch | Date: | Mon, 18 Feb 2008 17:41:41 +0000 |
| Subject: | Re: Fwrite Function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-269505@lists.php.net to get a copy of this message | ||
On Sat, February 16, 2008 6:03 am, Yuval Schwartz wrote:
> Hello,
>
> Can you please help me, I am writing code where I create a file and
> write to
> it from a form on a webpage and then read and display this file on the
> webpage.
> I want to change the color of the text that is written to the file.
> Do you know how I can do this?
>
> This is some of my code if you need clarification:
> * $boardFile = "MessageBoard.txt";
> $boardFileHandle = fopen($boardFile,'a') or die("can't open file");
> fwrite($boardFileHandle, $name);
> fwrite($boardFileHandle, $talk);
> fclose($boardFileHandle);
> }
> $boardFile = "MessageBoard.txt";
> $boardFileHandle = fopen($boardFile,"r");
> $talkR = fread($boardFileHandle, filesize($boardFile));
> fclose($boardFileHandle);
> echo $talkR;*
I would recommend not trying to colorize the text in the file, but
rather to colorize it upon display...
echo "<div style=\"color: red;\">$talkR;</div>\n";
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?