I followed the tutorial to create a simple app, testing the inline php feature. The only problem I'm having are that the app failed to open the php file and that the hello message didn't show.
Could someone show me how to make it working, please?
TIA
Web server for Chrome Console error:
Failed to load resource: net::ERR_CONNECTION_REFUSED localhost/myapi.php
2. Added a button skbtnHello to the WelcomePageLayout
3. Appended following code to the Main module
B4X:
Private Sub skbtnHello_Click (event As BANanoEvent)
SKTools.ShowToast("enterieng skbtnHello_Click", "info", 3000, True)
' function name and params are Case Sensitive!
Dim res As String = BANano.CallInlinePHPWait("SayHello", CreateMap("Name": "BANano"))
Log(res)
End Sub
' a simple php method which says hello!
#if PHP
function SayHello($Name) {
$ret = Array("answer" => "Hello " .$Name. "!");
echo json_encode($ret);
}
#End If
The previous posts are about running on localhost using the Web Server for Chrome.
I just changed BANano.PHPHost to point to test app location, where myapi.php is located, on the remote vps server. I got 403 forbidden error when trying to call the SayHello().