解析错误:语法错误,第30行的C:\ xampp \ htdocs \ user.php中出现意外的'else'(T_ELSE)

时间:2019-01-05 13:15:15

标签: php oop

<?php
include_once('Connection.php');

class User{


    private $db;

    public function __construct(){

        $this->db = new connection();
        $this->db = $this->db->dbConnect();

    }

    public function Login($name,$pass){

        if(!empty($name) && !empty($pass)){
            $st = $this->db->prepare("select * from users where name=? and pass=? ");
            $st->bindpram(1,$name); 
            $st->bindpram(2,$pass); 
            $st->execute();

            if($st->rowCount() == 1){
                echo"Access granted";
            }
            else{
                echo"Invalid username or password";
                }
                else{
                 echo"please enter username and password";
                }

    }

    ?>

0 个答案:

没有答案