- 724 Posts
- 3 Reply Likes
Posted 4 years ago
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
FAQ
Q: CAN YOU USE PHP/ASP/JSF/JAVA/.NET WITH PHONEGAP?
A: A PhoneGap application may only use HTML, CSS, and JavaScript. However, you can make use of network protocols (XmlHTTPRequest, Web Sockets, etc) to easily communicate with backend services written in any language. This allows your PhoneGap app to remotely access existing business processes while the device is connected to the Internet.
Chris Griffith, Champion
- 347 Posts
- 92 Reply Likes
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
(But you will - safely - have assumed that this was not what the OP had in mind)
- 283 Posts
- 40 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- install a web server with PHP engine, like DroidPHP, Palapa, KSWeb and others
- open a PHP script from the app in an inAppBrowser window (perhaps keeping the iAB window hidden), or of course use ajax or socket;
- retrieve the result values from the script in the app
I could even imagine that such PHP script could be linked to directly (either with a normal whitelisted hyperlink, or with the inAppBrowser('_self')), so the script could return valid html.
Note: I would not recommend this old way of using PHP, but shouldn't it work just fine?
For which part would a PHP plugin be required?
- 283 Posts
- 40 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
That's why I mentioned "(But you will - safely - have assumed that this was not what the OP had in mind) ", when Chris claimed that "server side solutions will not run locally on the device".
Installing a webserver with PHP first is something you would only do for projects in a non-public environment.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
https://www.npmjs.com/package/cordova...
I just don't see if a PHP engine is included. It might not interprete PHP.
- 283 Posts
- 40 Reply Likes
- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 724 Posts
- 3 Reply Likes
- 283 Posts
- 40 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
By now, the times where database requests, application logic and html form/design elements were all packed together in a single PHP document, should be considered history (I hope).
- 724 Posts
- 3 Reply Likes
- 283 Posts
- 40 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
So, you will have to redesign your application in such a way as to create PHP webservices that handle ajax/xhr requests from the app.
- 724 Posts
- 3 Reply Likes
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
- 724 Posts
- 3 Reply Likes
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers




