public
void
LogInPost() {
try
{
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setDefaultUseCaches(
false
);
http.setDoInput(
true
);
http.setDoOutput(
true
);
http.setRequestMethod(
"POST"
);
http.setRequestProperty(
"content-type"
,
"application/x-www-form-urlencoded"
);
StringBuffer buffer =
new
StringBuffer();
buffer.append(
"id"
).append(
"="
).append(userid).append(
"&"
);
buffer.append(
"password"
).append(
"="
).append(userpwd);
OutputStreamWriter outStream =
new
OutputStreamWriter(http.getOutputStream(),
"utf8"
);
Log.d(
"check"
,
"1"
+ userid);
PrintWriter writer =
new
PrintWriter(outStream);
Log.d(
"check"
,
"2"
);
writer.write(buffer.toString());
writer.flush();
Log.d(
"check"
,
"3"
);
Toast.makeText(getApplicationContext(),
"php접속완료"
, Toast.LENGTH_SHORT).show();
}
catch
(Exception e){}
}