To give you an idea on how to do this. Create one new table in your database.
Table Name `users_pm`
id Record Id
tuid To user ID
fuid From User ID
fname From User Name
subject Subject of message.
msgdate Date of Message
msg Message Text
Create a function that will check to see if the current log in user has any messages.
- Code: Select all
Function CheckPM()
{
//connect to mysql database
//mysql_select_db('database');
$query = mysql_query("select * from `users_pm` where uid = {$_SESSION['userid']}");
$record = mysql_fetch_array($query);
foreach($record as $upm)
{
echo 'From :'.$row['fuid'];
// and so on. Just display the messages from that user. You can include what you wanted the
// user is view. You can create links to view and reply to the message. Just use the same table.
}
mysql_close();
}
Hope this helps
Joe