It is dead simple, what dagon suggests.
I am using it myself in guestbook script. They can only write one guestbook entry per session,
this prevents not only 'double-posting' but makes it harder to spam my guestbook.
In your send-message page you put
<?php
session_start();
if(isset($_SESSION['done'])){
echo 'you have already sent message';
exit();
}
//here further down is part where message is actually sent
//and we put one note about this in session variable
$_SESSION['done'] = TRUE;
?>
But suppose the user want to go back and send another message
to somebody else now today when being online.
As long as $_SESSION['done'] isset (TRUE) he can not send anything.
What you could do, is to put in some other page, maybe index.php
a few lines to remove $_SESSION['done']
so user will be able to send again. Another message.
Put this in beginning somewhere of index.php or home.php
Should be a page that most often users goto.
<?php
session_start();
if( isset( $_SESSION['done'] ) ){
unset( $_SESSION['done'] ); //'unset' is same as remove the variable value
}
This will take away the BLOCKING of message sendning.