0

Ok, so I am building a CMS one of the features I wanted to add is ability for me to send messages to my friends which are also using the CMS currently in development mode. This point of the idea is to allow more fluent communication between me and them, since e-mail can be delayed sometimes and here i want to send a simple message to them. With something like following format

Name: Avatar: Subject: Date: Message:

I am pretty sure this can be easily rigged together with PHP and JSON just assuring the access to the JSON file is secure in which I implemented something like access key which checks if the site requesting the file matches site host, and matches the key.

In any case sorry for my babling, this is my way. But folks I would like to know what would you suggest in making cross-domain messaging system build in into a PHP + jQuery based CMS? In terms of being robust, fast, secure and easy to work with.

1 Answer 1

1

Exchange data in the jsonp format, http://en.wikipedia.org/wiki/JSONP.

Server:
How to convert php to jsonp with json_encode.
http://1080d.com/lang/en-us/2009/10/converting-php-to-jsonp-with-json_encode/

Client:
Ajax example of jsonp data call. This particular example concerns the timeout feature but is an excellent example of how to set it up.
jQuery ajax (jsonp) ignores a timeout and doesn't fire the error event

5
  • Sorry should have made my self slightly clear I actually was referring to jsonp since there ain't any other way you will get cross-domain support without the "p" in the end of json, I was just wondering if there is some sort of other techniques to do this just for comprising of speed/security/flexibility/intergration.
    – PT Desu
    Sep 27, 2011 at 2:59
  • I think what you are asking for could be created with jquery ajax jsonp to a php script that validates user credentials for security or you can handle authorization however you see fit. For a messaging system like a inbox on a webpage as an example at bare bone could be created within a few hours assuming you already have dev users setup. Sep 27, 2011 at 3:17
  • speed - as fast as an http request can be Sep 27, 2011 at 3:19
  • i did give this a though, the main chalange still is cross-domain. the fact is that JSON is stored on each's users server, but the question is retreiving and exchanging this info since there is NO CENTRAL SERVER to store this, unless I setup a central server for my CMS, otherwise I need to go back to drawing board. Since logically you can have 100+ friends with exect or outdated copy of the CMS, and as user you must have access to all older messages, hmm why not just fetch the file and store a physical copy associated with the site, hmm need to draw this out
    – PT Desu
    Sep 28, 2011 at 17:16
  • I would think a central server to handle requests would be a good way of going. Sep 29, 2011 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.