Hi Guys,
I am new to B4A eventhough I have purchased it over 2 years ago and have done all the updates.
The problem I have is trying to get some data from my app to a SQL database.
What I have done so far
Created Database with PHP and HTML file with a form and tested that it updates the Database - Works
Used URL string with data in browser and updates the database - Works
Tried to send the data from my app - Dows not Work - inserts a Blank record.
http://www.himel.co.za/sen_post.php?Barc=LEW901&Location=Durbs&User=Peter (Works)
Here is the code I used. Please if anyone can help point me in the right direction , I am sure it is something very small
Lib enabled are : Core (ver 6.80) and OKHttpUtils2 (ver 2.4)
Thank you in advance
[07-Mar-2017 12:51:36 Etc/GMT] PHP Notice: Undefined index: Barc in /home/himelcoz/public_html/sen_post.php on line 11
[07-Mar-2017 12:51:36 Etc/GMT] PHP Notice: Undefined index: Location in /home/himelcoz/public_html/sen_post.php on line 12
[07-Mar-2017 12:51:36 Etc/GMT] PHP Notice: Undefined index: User in /home/himelcoz/public_html/sen_post.php on line 13
are the errors I am getting on the server.
I would have thought it might have been my php code , but then it works using the url string
Change the Barc value to add more to the database or it will reject with a duplicate error
I am new to B4A eventhough I have purchased it over 2 years ago and have done all the updates.
The problem I have is trying to get some data from my app to a SQL database.
What I have done so far
Created Database with PHP and HTML file with a form and tested that it updates the Database - Works
Used URL string with data in browser and updates the database - Works
Tried to send the data from my app - Dows not Work - inserts a Blank record.
http://www.himel.co.za/sen_post.php?Barc=LEW901&Location=Durbs&User=Peter (Works)
Here is the code I used. Please if anyone can help point me in the right direction , I am sure it is something very small
Lib enabled are : Core (ver 6.80) and OKHttpUtils2 (ver 2.4)
Thank you in advance
B4X:
#Region Project Attributes
#ApplicationLabel: Post Info
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim job2 As HttpJob
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
job2.Initialize("Job2", Me)
job2.PostString("http://www.himel.co.za/sen_post.php","Barc=LEW019&Location=PMB&User=Peter")
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub
[07-Mar-2017 12:51:36 Etc/GMT] PHP Notice: Undefined index: Barc in /home/himelcoz/public_html/sen_post.php on line 11
[07-Mar-2017 12:51:36 Etc/GMT] PHP Notice: Undefined index: Location in /home/himelcoz/public_html/sen_post.php on line 12
[07-Mar-2017 12:51:36 Etc/GMT] PHP Notice: Undefined index: User in /home/himelcoz/public_html/sen_post.php on line 13
are the errors I am getting on the server.
I would have thought it might have been my php code , but then it works using the url string
Change the Barc value to add more to the database or it will reject with a duplicate error
Last edited: