<?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";
}
}
?>