Hi,
I am using a simple private chat room for a company meeting but I am encountering some problems:
First, I am using .txt file instead of database to hold the messages, but I need to manually empty this .txt file every 2 days otherwise you get error message saying that the file is "full", I need to know how to create a script that automatically, every 2-3 days, cleans up for completly this messages.txt file (erases all inside).
Second, when chating the frame screen when refreshs goes to the first line instead to the last one in use, so you have to keep scrolling down to read the messages posted at the chat room. Do you know how to fix it?
this is the input.php file, this file is the one that rights the message in the chat room:
<?php
if($txt!=""){
$fileOpen=@fopen("messages.txt", "a");
@fwrite($fileOpen,"<font color=\"#ff0000\"><b>".$COOKIE['nick']." >> </b></font>".$POST['txt']."<br>");
fclose($fileOpen);
}
echo "<style type=\"text/css\">BODY{font-family:Verdana, Arial, Helvetica, sans-serif}</style>
<form method=\"post\" action=\"input.php\">
<input name=\"txt\" type=\"text\" size=\"50\" id=\"txt\">
<input type=\"submit\" name=\"Submit\" value=\" Chat! \">
</form> <a href=\"logoff.php\" target=\"_top\">Log Off</a>
";
?>
I really hope that someboday can help me with that...
Tks, Carla