How to program a web messaging

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rchung
Forum Newbie
Posts: 1
Joined: Mon Jan 26, 2009 5:23 pm

How to program a web messaging

Post 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
User avatar
Sindarin
Forum Regular
Posts: 521
Joined: Tue Sep 25, 2007 8:36 am
Location: Greece

Re: How to program a web messaging

Post 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.
Post Reply