Link to home
Start Free TrialLog in
Avatar of zerog
zerogFlag for South Africa

asked on

Display PHP content using Adobe AIR

I used the following snippet to create a wrapper in FlashBuilder for an html/php application.

<mx:HTML id="myBrowser" location="http://127.0.0.1/index.html" 
       width="100%" height="100%" />

Open in new window


I have a local server running to serve the PHP pages. The problem I have is that the html pages display perfectly except the ones that have PHP code in them. Is there something I'm doing wrong? I'm using FlashBuilder 4.6
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

From what we see here, there is no PHP involved at all.  PHP is a server-side scripting language.  It is used to generate HTML documents that are then sent to the browser on the client side after the PHP script has finished running.  And PHP scripts are typically named with a suffix like ".php"

Perhaps you can set up the SSCCE that demonstrates the issue?  Then we can try to duplicate the problem on our servers, and maybe can get a little more insight.
Avatar of zerog

ASKER

In the PHP example I was linking to

<mx:HTML id="myBrowser" location="http://127.0.0.1/index.php" 
       width="100%" height="100%" />

Open in new window


But I just get a blank.
What do you get when you point your browser to http://127.0.0.1/index.php ?
Avatar of zerog

ASKER

Thank you for your prompt response. When I point my browser to the php page on local server it fine as it suppose to be.

Some background:

I'm using Server2Go as a local WAMP server. The settings in Server2Go allow you to execute an EXE when the server is started. I've set it to execute the testAIR.exe that I created in FlashBuilder. The code that makes up testAIR.exe is

<mx:HTML id="myBrowser" location="http://127.0.0.1/index.php" 
       width="100%" height="100%" />

Open in new window

With all the stuff in the same folder I tried changing the location to index.php, but it still didn't work.

Maybe I should upload a sample ZIP of everything.
OK, so we know that the PHP script is not part of the problem.  I think my next test would be to replace http://127.0.0.1/index.php with the URL of a known resource that contains a very simple HTML document.  If that works in the context and the PHP script fails, it would indicate to me that the PHP parser is not getting called in the context.
Avatar of zerog

ASKER

Will try that. If I change location to index.html, then testAIR.exe shows the html page. But maybe I should link to the html page using the local URL i.e. http://127.0.0.1/index.html 

Will update you.
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of zerog

ASKER

Thank you for the your detailed response in trying to help eliminate the problem I was experiencing. Using your code snippet, it seems that the testAIR.exe was calling the php file before the server2go WAMP stack was starting the server and php modules. Although the delay between the start up of the two was just a few seconds, it's what caused the problem.
Thanks for the points -- it's a great question!  And thanks for using EE, ~Ray