Tom Simon
Posts: 0
Joined: Mon Feb 16, 2015 1:03 pm

Adding FORM to my web app for PHP submission

I am building a web app, but the back end will be processed on a PHP server. I am trying to figure out how to build the forms since the input fields and buttons (for submitting) don't use the FORM tag. I see the HTML control has a FORM type. How do I use the two together? What is the best way to use standard form fields for submission inside of Appery?

I am also trying to build an app that can have the PHP code inside of the code at Appery. I don't want to take the code offline, add the PHP code and then re-edit to add the PHP again after I make any GUI changes at Appery. Is this possible using the HTML control or any other way? I know that once I manually edit the html pages at Appery I lose the ability to manage the GUI elements.

Thanks.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Adding FORM to my web app for PHP submission

Hello Tom,

1) You can add any html code, including forms with all elements in the html component.
Although the form in the usual format by itself in Appery.io app is not very suitable. Instead, you should send data to your server via rest request (using rest service and mapping). And process the result (with the mapping of response and success/complete/error events of the service)
2) Unfortunately you can't insert php code in the Appery.io application. PHP is a server-side language, and Appery.io app is executed in the client browser.
The best way is to implement a rest API (with php) on your server and to use this rest API in Appery.io application.

Tom Simon
Posts: 0
Joined: Mon Feb 16, 2015 1:03 pm

Adding FORM to my web app for PHP submission

My original intention was to create the code in Appery, export the HTML5 code and add the PHP code to use on the server. The only problem is that if I need to make GUI changes in Appery I would need to export the code again and re-add the PHP code. This could become very cumbersome.

I will look at doing the Authorize.net and database work using REST, but this code would only work from the Appery.io hosted account then, right? Would there be any way to use exported code (run from my server) and still do the REST calls?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Adding FORM to my web app for PHP submission

Hello Tom,

We are very sorry for the radio silence here, we had to consult with some of our developers, and they said that this will require to implement custom logic, but this is possible.

Tom Simon
Posts: 0
Joined: Mon Feb 16, 2015 1:03 pm

Adding FORM to my web app for PHP submission

What type of custom logic? Where do I go from here?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Adding FORM to my web app for PHP submission

Tom,

To make your web app work with php code please try to test it in the Appery.io editor first:
1) Create a rest service with parameters of your php endpoint accepts
2) Test it in the Appery.io project
3) Export it as web app
4) Now you don't need to insert any php code to the exported web app's files, cause it is self-sufficient

You web app will make all calls from browser to your API implemented in php, results which you can map back to the map, without any php insertion

Return to “Issues”