Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

How Do I Make a Multi-User Messaging Service?

php website messaging communication multi-user user social networking html iframe

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1 AlfieD

AlfieD

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 04 February 2014 - 11:36 AM

Hi,

 

if you take a quick look at pesterlog.tk and log in as Alfie (user=alfie pass=davies123 no, you've not hit the jackpot by finding someone stupid enough to give you his or her password for anything; the only reason there's a username and password was to test if we could actually do it or not) you'll see that there's a pretty basic messaging system going on; for the Alfie user, when he sends a message to Peter for example, the message is written to a .txt file and then on Peter's page it's shown via an iFrame of that file. However, this is considered to be very problematic in the long run because as the amount of users increases, the amount of files that would need to be created (a sent to b, a sent to c, a sent to d, and so on) go up exponentially.

 

My idea for a new system would be to write a variable (the person who you want to send the message to) and use that variable in a url submission. For example, if I were to send a message to Peter, I would send the message as I do with the current system, but instead of the message writing on alfiesenttopeter.html etcetera, it would write to a decision file which would look at the string and decide to post it on the desired recipients 'wall'. However, after that, the decision file would then need to be erased so that messages don't get clogged up and I think you can see what I'm trying to get at.

 

This is not the new system we have to go for, and if you have any suggestions about a more efficient system then the one specified above I would be very grateful, and I'm not asking you to just write the code obviously, but if you wanted to I would have no complaints! I'd just like some guidance as to how I should proceed. All the code is on the website mentioned at the start of this post. If you need any further code or general clarification I'm more than happy to provide. :)

 

AlfieD



#2 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts

Posted 05 February 2014 - 01:35 AM

Welcome aboard Alfie,

 

Well, about the "lotsa files" thing, you can always mount a RAM disk ;)  . Just to say something I wanted to.

About the messages, you don't need the files, you can actually send the message as POST, and simply transmit the message string.



#3 0xDEADBEEF

0xDEADBEEF

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 790 posts

Posted 05 February 2014 - 03:32 AM

You need a database really.


Creating SEGFAULTs since 1995.





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download