Forum Moderators: coopster

Message Too Old, No Replies

creating messaging service with php

php files

         

rokec

3:29 pm on Oct 17, 2006 (gmt 0)

10+ Year Member



I want to create a messaging service (user will send message to another user). For example, if user "knban01" wants to send message to "jack06", then kban01's mesage will be written to messages/jack06.txt. And then, jack06 will want to wiew his messages (jack06.txt will contain more messages), so php will read his file and write it on screen:

Example of jack06.txt:
1 //unread message
42639524 //unix timestamp (sending time)
Hi, how are you? /n Bye!
0
46294323
Are you going to meet me?
0
48352538
Have a nice day
//eof

So jack06 should see a table with all incoming messages, sorted by unread and then by date of sending.
So, script must read first 3, another 3, another 3 until end of file (eof)

I will be very glad if you could hemp me with this comlicated script!

Psychopsia

3:35 pm on Oct 17, 2006 (gmt 0)

10+ Year Member



Hi rokec! Are you thinking in real-time messaging system?

rokec

3:44 pm on Oct 17, 2006 (gmt 0)

10+ Year Member



no, not a realtime...

this other user should see this message anytime...

jatar_k

4:16 pm on Oct 17, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



where are you having trouble rokec?

the logic looks fine

rokec

4:22 pm on Oct 17, 2006 (gmt 0)

10+ Year Member



Trouble is when i try to write that script... I don't know where to start ;)

jatar_k

4:38 pm on Oct 17, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



start with the design of the file structure

then work on the writes - your form to enter and the actual saving

then work on the displaying of the messages

then see what's happening