help modding an old script

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I wrote this last year, when i was getting into PHP, it was easy at the time  
to write, however I have since not held my intrest in PHP so am looking for  
some help adding to what is already here

here is the code



$error = " ";
$filename = "data.dat";
$box = " ";
$max = "2048";
$message = stripslashes($message);

if(filesize($filename) > $max) {
if (empty($name) || empty($message)) { header( "Location: $error" );
} else {
header( "Location: $box");
$a = fopen( $filename, "a") or die ("could not open $filename for writing  
please check file permissions");
flock($a, LOCK_SH);
fwrite($a, "<font face=verdana size=1><b>$name</b> : $message</font>
<hr noshade size=1 color=000000>");
flock($a, LOCK_UN);


I want to be able to stop people from writing to the data.dat file  
constantly over and over, or flooding the file, or maybe even prevent  
identicle entries, however just a quick and easy way to implement to stop  
posts being sent one after the other over and over would help greatly.

If anyone could maybe provide a snippet of code and instructions on where to  
place the code i would greatly appreciate it, or if anyone could point me in  
the direction of an example or information about adding a feature like this  
i would much appreciate it

Thanks In Advance


Site Timeline