Happy New Year David.
Please can you guide me on how to add more data to a JSON file using php.
Thanks.
In addition
I want to create a UI that the user will fill and send and get a success response when the data is updated on a server.
Happy New Year David.
Please can you guide me on how to add more data to a JSON file using php.
Thanks.
In addition
I want to create a UI that the user will fill and send and get a success response when the data is updated on a server.
Hello Tonym,
In order to append JSON data or just play with JSON data (editing, adding, removing, etc.) using PHP there is only a way that I know and it's to decode the JSON file in order to get the saved structured data. Play with that data and, when finish, encode it as a JSON string and save to the file. All of these are based in the "json_decode" and "json_encode" PHP functions.
Said that remember that JSON can be very good to send and receive data from and to our applications, but we no need to store the data as is in the server side. In few words, we can save our application data in a server database, for example, and, maybe, send JSON data when the application requires someone, or use JSON to receive data from the application. But not necessarily store that data in a JSON file.
About the other question, that is, how to prepare an UI to send data to the application server, in fact there can't be more easy. You can take a look at several samples like the "HttpClient" one. We can show Inputs controls (several of them are included in App Builder like Text Input, Number Input, Date Input, etc., etc.) to the application user, and then just prepare the HttpClient to send the appropiate input's values to the application server.
Once the server receive our application HTTP call they can reply with the appropiate response, which is received by the application using the HttpClient control Error or (more commonly) Success event. Then we can do whatever we wanted with the server's response. And of course the server previously do whatever we wanted with the received application's data, like save it into a database, etc.
Happy New Year to you too Tonym! ;)
Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.
Este sitio utiliza "cookies" útiles para almacenar sus preferencias.