I'm trying to build an Adobe Air app which runs from a PHP file.

Currently I have an index.html file which then performs a location.href to move to realfile.php - this gets round the limitation that a root file has to be HTML.

My problem is that the *.php files contain JavaScript which in turn make use of Adobe Air code, specifically printing. I overwrite window.print to the Air version which works fine in HTML.

As soon as the code is copied to the PHP file it doesn't even attempt to call it, yet other JavaScript works fine.

Accepted Answer

I read around a bit more and now know that Air will only run in a HTML page. Although there is no explanation that I could find that explains why this is...

How I think I can fix this:

My current idea is to add a RewriteRule in my htaccess to make PHP files accessible via a .html file extension. This should trick Air into thinking it's a HTML document, whilst the server is still able to process the PHP that is on the page.

When I get around to it, I'm more than happy to re-write the app to make it fully AJAX driven, which is what everyone else seems to be doing.

Written by James
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki