Php in Adobe Air?

I have noticed this video on Adobe tv site:
http://tv.adobe.com/watch/adc-presents/creating-flex-and-php-projects#save-to-library
Is it saying that it is possible to use server-side scripting into an air app?
The video example shows that it seem to be able to work with FLEX.
If so, how can PHP be used in Air with just using HTML and AJAX?
Can someone help me out with this?
LVL 8
Sam CohenConsultant to Digital/DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
Hello all4artz,

There's no problem, PHP run on server side and Flex+Air/Ajax run on client side.

Regards.
0
CyanBlueCommented:
Yes, you are not putting PHP script inside your ActionScript or MXML code...  You simply make a HTTP call to PHP that resides on a server side and have it do something...  You can work with any types of server side scripts but you cannot put that inside your AIR application...

CyanBlue
0
Sam CohenConsultant to Digital/DeveloperAuthor Commented:
So Is there any solution to having pHP run on client side of an air app?
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

leakim971PluritechnicianCommented:
Yes you do that when you open some page in your web browser...
0
CyanBlueCommented:
If you want to run PHP along with the AIR app, you will either need to have a web server somewhere on the internet or on the same computer...  You will need a web server regardless...  You cannot somehow embed the PHP script inside the AIR application...

CyanBlue
0
Sam CohenConsultant to Digital/DeveloperAuthor Commented:
Thank You Cyan Blue,
That is straight to the point!
Because I am trying to develop an air app and I need form submission... and i am not so familiar with ajax, i am a php person.

Thank you also leakim971 for your prompt response.

My question is , Is there any alternatives to doing things i want to do with php, with ajax?
0
CyanBlueCommented:
So, can you tell me what kind of form it is, and what PHP function you'd like to execute when you click the button???
Are you using AS3 to create an AIR app???

CyanBlue
0
Sam CohenConsultant to Digital/DeveloperAuthor Commented:
No just Ajax and Html



See what i can't seem to understand is that there are full working minified apache servers on usb thumb drive , which enable a user to run his store locally from a USB THUMBDRIVE....why cant that be the same with an Air local app??
0
CyanBlueCommented:
Yes, such package exists...  You sure can have your user install AIR application along with such package so that you can run your PHP script over it...  

CyanBlue
0
Sam CohenConsultant to Digital/DeveloperAuthor Commented:
Great!!! So do you know where i can find such a thing. I only remember vaguely that, that was possible.
0
CyanBlueCommented:
I only used proprietary ones on the job, so that won't apply to you...

I did a quick google and these came up...
   http://www.server2go-web.de/
   http://www.chsoftware.net/en/mowes/mowesportable/mowes.htm
   http://www.blackdot.be/?inc=apache/httpserveronusb

CyanBlue
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sam CohenConsultant to Digital/DeveloperAuthor Commented:
Hey Cyan!!
I just tested my MAMP (local apache server for mac)
with my Air app , and the local php files work great within my app!
See adobe air has it own browser built in

My theory is that if there is a way to activate a minified apache server on launch of an air app , then php, sql, perl, etc .. can be possible. It can work the same way a usb portable server works, sort of like usbserver.com

The question is can Javascript activate a start or /and stop of a mini server?

I will look on sourceforge for some minified server.

Thanks Cyan for you putting me in the right direction!
0
CyanBlueCommented:
I think I am abit confused at this point...  Let's clarify things abit...

So, you have an AIR app that requires to communicate with the PHP script which requires a local web server...

When you deploy your AIR app, do you plan to have your user to download a WAMP/MAMP along with your AIR app or do you just want to state that your app requires a local server to run it???  I am thinking that you probably need to create your own package of WAMP/MAMP that includes your PHP script cuz you will not be able to know the name of the directory where your client's web server is running...

So, tell me what your deployment plan is for this and maybe we can streamline the solution/suggestion for you...

As for JS activating a webserver, I don't think that's possible...  Maybe you can create a batch file/applescript that does that 'if' you know the name of the directory where your client's web server runs and the name of the executables cuz that could be different depending on what type of web server that needs to run...

CyanBlue
0
Sam CohenConsultant to Digital/DeveloperAuthor Commented:
Ok i might see your point.

The problem is that Air only allows coding 3 different ways: HTML&AJAX, Flash or Flex
I wish they figure out a way to allow php. That only way that php can run on a native system , is if a local server was present. I have read articles and said that running a server off a usb or just a folder is possible.

So i thought that if i can load a folder into he air app that runs the server on install of the air app then coded with PHP would be possible.

http://www.uniformserver.com/ shows that it is possible to run a server out of folder with installing.
So i just figure that i can compressed this server files folder with the air app so that they can load together.
When the Air app loads then perhap js, as, ajax, or what ever can activate the start.bat file , thus initializing the server.

DO this sound possible?
0
CyanBlueCommented:
I guess you have to ask them to see if you can invoke the server to run via javascript(not likely) or batch file...  If you can, you can run it from your application...  I don't know how to invoke a batch file from the HTML/JavaScript AIR app though...

CyanBlue
0
CyanBlueCommented:
Any update???  Please elaborate if you still have the problem, otherwise close the topic...

CyanBlue
0
Sam CohenConsultant to Digital/DeveloperAuthor Commented:
I am working through those solutions

0
Sam CohenConsultant to Digital/DeveloperAuthor Commented:
No straightforward answer to my question, however it put me in a good direction.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Flex

From novice to tech pro — start learning today.