How to validate the user login credentials in android using PHP, MySql with the help of json

后端 未结 3 1823
暖寄归人
暖寄归人 2021-01-06 06:01

I am new to android development. I want to do the login verification, using php mysql and json.

I am only taking care of the PHP, MySql and json part.

If t

3条回答
  •  清歌不尽
    2021-01-06 06:23

    just follow this code i think its work fine...

    $email = isset($_REQUEST['email'])?urldecode($_REQUEST['email']):"";
    $passwd= isset($_REQUEST['passwd'])?urldecode($_REQUEST['passwd']):"";
    if($email==""||$passwd=="" )
    {
    $return_data['status'] = 0;
    
    }
    else
    {
      $user_info="select id from table name WHERE email=$emailAND passwd=$passwd";
        if($user_info)
          {
           $return_data['status'] = 1;
          }
         else
        {
         $return_data['status'] = 0;
        }
    }
    echo json_encode($return_data);
    

提交回复
热议问题