0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
model
/
[
Home
]
File: authenticate_mdl.php
<?php //require_once "lib/config.php"; require_once BASE_DIR."/lib/db/DBConnection.php"; class Auth { public static function isValidUser($uname,$passwd) { $con = DBConnection::getConnect(); $sql = "SELECT user_name,passwd from user WHERE user_name = ? AND passwd = ? "; try { $stmt = $con->prepare($sql); $stmt->bind_param("ss", $uname, $passwd); if($stmt->execute() ) { $stmt->store_result(); if( $stmt->num_rows > 0) { return "True"; } else { return "Invalid"; } } $stmt->close(); } catch(Exception $ex) { echo "Auth::isValidUser() ->". $ex-> getMessage(); return null; } } } ?>