Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
API
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
$servername="localhost";
$username="id7989663_akshay";
$password="akshay";
$dbname="id7989663_user_db";
$conn=mysqli_connect($servername,$username,$password,$dbname);
if(!$conn){
echo"Database Not Connected";
}
$uname=$_GET['email'];
$password=$_GET['password'];
if (!empty($_GET))
{
if (empty($_GET['email']) || empty($_GET['password']))
{
$response["success"] = 0;
$response["message"] = "One or both of the fields are empty ....";
die(json_encode($response));
if($count>0){
$response["success"] = 1;
$response["message"] = "You have been
sucessfully login";
die(json_encode($response));
}
else{
$response["success"] = 0;
$response["message"] = "invalid userid or password ";
die(json_encode($response));
}
else
{
$response["success"] = 0; $response["message"] = " One or both of the fields are
empty ";
die(json_encode($response));
}
mysqli_close();
?>
??????????????????????????????????
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Toast.makeText(Login.this, response,
Toast.LENGTH_LONG).show();
try {
System.out.println("+++++++++++++++++++++++++++
++++" + response.toString());
JSONObject oo = new
JSONObject(response.toString());
String res = oo.optString("success");
// String msg = oo.optString("message");
if (res.equals("1")) {
System.out.println("Message****" + res);
// System.out.println("Message****"+msg);
// JSONArray contacts =
oo.getJSONArray("response");
Toast.makeText(getApplicationContext(),
"valid Login", Toast.LENGTH_SHORT).show();
}) {
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<>();
params.put("email",gmail );
params.put("password", password);
return params;
}
};
RequestQueue requestQueue =
Volley.newRequestQueue(getApplicationContext());
requestQueue.add(stringRequest);