Run php script stored in the server?

*爱你&永不变心* 提交于 2019-12-20 15:21:58

问题


I have a php script stored in Wamp server, and want that my application execute it to perform some image treatement from server then the server send the result to the Android phone. Is that possible to perform ? And please if so can you give some hints?

Thank you very much.


回答1:


Simply perform HTTP get request:

String url = "http://your.domain.com/path/to/file.php";
HttpClient client = new DefaultHttpClient();

try {
  client.execute(new HttpGet(url));
} catch(IOException e) {
  //do something here
}



回答2:


There are various ways to do that 1. You can call the script using webrequest.create from your application Or you can use CURL in case of php application 2. You can execute the script using cron job and schedule it to run according to your need

Link 1

Link 2



来源:https://stackoverflow.com/questions/8358967/run-php-script-stored-in-the-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!