Page 1 of 1

How to program a web messaging

Posted: Mon Jan 26, 2009 5:30 pm
by rchung
i am wondering how i can do the messaging feature like the one in facebook

being able to message people and the message remain in their index box ,at the same time the receptict receive an email of notification telling them to read the message by logging in

the sender will not know the person s actually email address

what is this called

can anyone help,
please

thanks in advance

Re: How to program a web messaging

Posted: Tue Jan 27, 2009 3:16 am
by Sindarin
You mean a Personal Messaging system?

How I'd do it is use a database to store the messages.

When user1 sent a message it would INSERT in a row:
message_id|message_subject|message_body|message_from|message_to

Then when user2 logs in we SELECT from the table the row(s) that contains message_to with his username/id etc. and return those messages to him by displaying the whole row data formatted nicely in his webpage.

No mail() function is needed as everything will be virtual.
I would strongly recommend using a database over plain text files because it's more secure and organized that way.