The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
The thing that Monkey_Man asked for, got me coding, and trying to make a simple ... v.simpl I should say, lol ... chat site.
Just all the msg's are coming up in the wrong order ... so if you (or anyone else here) know how to put the content of a .dat file into a PHP Variable, lets say $Chat_Text, I'd be greatful :o)
You should be able to use the , and tags, but nothing else.
You should also be unable to post blank messages.
Would be greatful if you could see if it does that ok, and that the msg's come up ok for you.
Seem sot work ok for me, but I may have missed something
Thanks guys.
I tried that htmlentities(); thing but the speach-marks came up as "\" \and \""
what have I done wrong?
Cheers for the help :o)
$Chat_File = "Chat_Text.dat";
$Text = trim($Text);
if (! empty($Text)) {
$fp = fopen($Chat_File, 'w');
$datfile = fread($fp, filesize($Chat_File));
fclose($fp);
$fp = fopen($Chat_File, 'w');
$Time = date("g:ia");
fputs($fp, "\n$Username: $Text ($Time)
");
fputs($fp, $datfile);
fclose($fp);
}
or have I got that wrong??