I found this script on the internet...It's a script of a message 
board...My problem is that I just want to display the 30 newer messages 
stead of all messages...What do I have to change???
I tried to use the file() function...I know it's possible to do what I 
want to with that function, but I don't know how.
Please, help me!!!!!

            
...............................................................

script:
<?

if ($message)
    {
    $message = strip_tags($message);
    $message = ereg_replace("\r\n\r\n", "\n<P>", $message);

        if (get_magic_quotes_gpc())
            {
            $message = stripslashes($message); 
            }


    $date = date("d/m/Y - h:i a");
    $message = "<B>$user </B> -- $date<P> $message <BR><HR>\r\n";
    // first read the file into a buffer, if it exists
    $textfile = basename($PHP_SELF) . ".comment";
    if ($fp = @fopen ($textfile, "r")) // open without complaining
        { 
        $oldmessages = @fread($fp,filesize($textfile));
                       @fclose(fp);
                       }
        // now reopen the file in write mode, with the 
        // pointer at the head of the file
        $fp = fopen ($textfile, "w");
        fwrite ($fp, $message);
        fwrite ($fp, $oldmessages); // adding back the old messages
        fclose ($fp);
        }
        @readfile(basename(($PHP_SELF . ".comment")));

?>

            
...................................................................
Thank you

Felipe Lopes
MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faça já o seu. É gratuito!!!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to