I have developed something similar, where they write their message, and it saves to a file on the database, then the person that it was sent to gets a notification that someone sent them a message and then if they reply the file just gets editted. So it's just changing file access.
Common man, you been writing application all these years. I know you can do it.
Here is an example of a basic table structures of a internal PM system. Similar structure I used on the codeIgniter Library I wrote in the past.
here we go :
Table Name: messages
CREATE TABLE IF NOT EXISTS `messages` (
`message_id` int(11) NOT NULL AUTO_INCREMENT,
`m_title` varchar(255) NOT NULL,
`message` mediumtext NOT NULL,
`message_type` varchar(100) NOT NULL,
`sender_email` varchar(255) NOT NULL,
`sender` int(10) NOT NULL,
`sender_name` varchar(255) NOT NULL,
`recepient` int(10) NOT NULL,
`rec_time` int(20) NOT NULL,
`read` varchar(10) NOT NULL,
PRIMARY KEY (`message_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=35 ;
I don't have much time to reassemble these, but I will provide you with the screenshots I believe you will need to get this done.
First, you need to have a class to retrieve the messages and deliver them to the member's inbox.
it should look something like this
as you can see the trash bin on the right is triggered through ajax. The message compose page
To send a message you need to collect the form data and reference to them.