Ning, PHP & FLash

Published: September 21, 2008

Antano Solar John is the creator and developer of the most advanced technologies to design and fast-track personal evolution and an investor in startups that have access to cutting-edge solutions for personal excellence.

Javascript(Jquery) -> PHP(same domain) -> flash -> PHP(same domain) -> PHP(remote server)

Ever had to make so many calls to display a simple flash object?

It was saturday and I was enjoying the leisure of being at home. When I got a call from an old prospective client. It was an emergency and deliveries had to be made the very night. It had something to do with Ning. Though I have never worked on ning before, the idea of doing a cross-site script sounded like fun! The client wanted a block within Ning to pass user data two ways to a flash object. The bottle neck is, the block understands only HTML. Ths was fixed using javascript to load a PHP  using AJAX request. The PHP file  being in the same server as Ning had access to the user’s session using Ning’s API. Then the PHP script rendered the flash object injecting the appropriate variables using query string. The second bottle neck was this, the flash script has to pass values to a php script that saves something in a database. We couldnt use mysql_connect as those libraries were not available in the ning server. So we had to call an external PHP script  in another server which can manipulate DB. Another bottleneck, when I realized flash has security restrictions on calling scripts from other site. Time for php proxy :)

So in the end the complete flow looked like the following

Javascript(Jquery) -> PHP(same domain) -> flash -> PHP(same domain) -> PHP(remote server) -> MYSQL

The whole experience was so exciting that I am writing this, just a few minutes after completion :)

Related Posts

Rails on Lion

Rails on Lion

Ruby HTTP Post with JSON Request + SSL + Certificate + Basic Authentication

Ruby HTTP Post with JSON Request + SSL + Certificate + Basic Authentication

Tools & Showcase

Tools & Showcase

5 Min Mentor – Quick and Measurable Learning by Content Free Diagnosis

5 Min Mentor – Quick and Measurable Learning by Content Free Diagnosis

The Antano Solar Voice  is one of the most cutting-edge blog and podcast in the world with fresh insights from validated life experience. The Solar Voice season 1 podcast has been ranked #3 in Apple iTunes News & Noteworthy. And the posts have been published in over a dozen publications including Business World, YourStory, Hindu Business Line, Economic Times and  many more. To listen to any of the past episodes for free, check out this page. And to read the past article, check out the blog page.

Leave a Reply


Your email address will not be published. Required fields are marked

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}