0byt3m1n1
Path:
C:
/
GEOMATICS 23-01-2021
/
LAN
/
CPMS code
/
CPMS
/
[
Home
]
File: logincheck.php
<?php @session_start(); require_once "lib/config.php"; require_once BASE_DIR."/lib/db/connection.php"; class Login { public static function loginCheck() { $u_name=@$_SESSION['username']; $password=@$_SESSION['password']; $sql="select * from user where user_name='$u_name' and passwd='$password'"; mysql_query($sql); if(mysql_affected_rows()>0) { if(@$_SESSION['username']=="admin") { return "Admin"; } else if(@$_SESSION['username'] != "admin") { return "User"; } else { return "Invalid"; } } else { return "Invalid"; } } } ?>