This is php code:
<?php
include_once('connection.php');
class user{
private $db;
public function__construct(){
$this->db = new Connection();
$this->db = $this->db->dbConnect();
}
public function Login($user,$pass) {
if(!empty($user) && !empty($pass)){
$st = $this->db->prepare("select * from users where name=? and pass=?");
$st->bindParam(1,$name);
$st->bindParam(2,$pass);
$st->execute();
if($st->rowCount()==1){
echo "user verified, access granted";
}else{
echo "incorrect username and password";
}
}else{
echo "please enter username and password";
}
}
}
?>
In line7, it shows Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE.
Can anyone tell me how to fix this?