本地主机上的Android Connection PHP,ResponseCode 501

时间:2019-06-30 07:51:28

标签: php android localhost response

我只是想将我的Android App与Localhost上的PHP Server连接起来。当我degbug时,我得到的响应代码值为501。

server.php

  addComponent() {
    const componentFactory = this.componentFactoryResolver.resolveComponentFactory(ChildComponent);
    const viewContainerRef = this.injectComp.viewContainerRef;
    const compRef = viewContainerRef.createComponent(componentFactory);
    compRef.instance.someProperty = "some data";
  }

我的MainActivity

if(isset($_POST['email']) && isset($_POST['password'])){

    $result = "";
    $email = $_POST['email'];
    $password = $_POST['password'];
    $sql = "SELECT * FROM tbl_user where email='$email' AND password='$password'";
    $result = $conn->query($sql);
    if ($result->num_rows >0) {
            while($row[] = $result->fetch_assoc()) {
                    $tem = $row;
                    $result = "true";
                    $json = json_encode($tem);
                }

            } else {
                $result="false";
                echo "No Results Found.";   
        }
                echo $result;
                echo $json;
}

0 个答案:

没有答案