Answer the question
In order to leave comments, you need to log in
How to send data to the server and get the result of PHP code?
I have code (Android):
URL url = new URL("my URL");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setRequestMethod("POST");
connection.connect();
And this code accesses PHP file with code:
<?
$login = $_POST["login"];
$pswd = $_POST["pswd"];
$str = "done";
echo $str;
?>
How do I get the result of the PHP code, that is, the line "Done"?
And How can I send data using HttpURLConnection so that $_POST is not empty?
Answer the question
In order to leave comments, you need to log in
www.xyzws.com/javafaq/how-to-use-httpurlconnection... Have a
look at org.apache.commons.httpclient.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question