1. Have a JSON object on the page where somebody wanted this application to run.
2. Every 30 seconds, use an AJAX post to send this JSON object to a locally hosted .php file.
3. Have the locally hosted .php file format the JSONP object accordingly and send it to the cross-domain .php web service.
4. Have the web service push the data into a locally (on the cross-domain) hosted MySQL database.
5. Have the web service return a JSONP object that signifies the push was successful.
6. Have the locally hosted .php file return the successful flag to the page.
All that being said, here are the questions I have about this process:
First and foremost, is this even the best approach? I have heard JSON is more efficient to pass back and forth than xml.
Second, assuming that this is a proper approach, can somebody point me to some reference material as to how to send JSONP data across domains via php?
Third, if there are any glaring security flaws with this approach, what are they and how do I overcome them? The domain that the MySQL database and php web service will reside on is static, so hard-coding where to send requests to and accept responses from would not be a problem.
Any advice whatsoever on how to approach this process would be greatly appreciated. Thank you in advance!