help modding an old script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christo

    help modding an old script

    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

    //CODE

    <?php

    $error = "http://www.yoursite.co m/shoutb0x11/error.php";
    $filename = "data.dat";
    $box = "http://www.yoursite.co m/shoutb0x11/shout.php";
    $max = "2048";
    $message = stripslashes($m essage);

    if(filesize($fi lename) > $max) {
    unlink($filenam e);
    }
    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);
    fclose($a);
    }
    ?>

    //CODE END

    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

    Christo


Working...