How to run a server side php file in J2ME
I am developing a server-client application with using J2ME. There I need the client program to access the server and view data. For doing this, I made an HTTP connection with the server. Now I want to run a php file which is located in server and doing the needful. But I couldn't able to find a way to run the server php file using my client app. Please a开发者_JS百科nyone can help on this ?
If I understand you right the solution is as follows:
- Implement a php-script that gets POST or GET request and save it in a file. For instance: "yourscript.php". This script does what is necessary and generates the output, let say in plain text format.
- Implement a J2ME functionality that opens HTTPConnection and makes POST or GET request to http://www.yourserver.com/yourscript.php (according to your php-script expectations) and reads the server response.
That's it.
精彩评论