Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run php script stored in the server?

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.

like image 588
androniennn Avatar asked Sep 11 '26 00:09

androniennn


2 Answers

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
}
like image 140
ioseb Avatar answered Sep 12 '26 14:09

ioseb


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

like image 24
Raj Kumar Avatar answered Sep 12 '26 15:09

Raj Kumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!