Linux altar53.supremepanel53.com 4.18.0-553.8.1.lve.el8.x86_64 #1 SMP Thu Jul 4 16:24:39 UTC 2024 x86_64
/ home/ bdapparelinfo/ hi-techplasticltd.com/ Wp-Administrator/ classes/ |
|
<?php //DB.class.php class DB { protected $db_name = 'bdappare_hitechplasticltd'; protected $db_user = 'bdappare_hitechplasticltd'; protected $db_pass = 'Y*=zM!2GJNk}'; protected $db_host = 'localhost'; //open a connection to the database. Make sure this is called //on every page that needs to use the database. public function connect() { $connection = mysql_connect($this->db_host, $this->db_user, $this->db_pass); mysql_select_db($this->db_name); return true; } public function login($userId, $password) { $real_pass = md5($password); $select_user = "SELECT * FROM admin WHERE user_id = '".$userId."' AND password = '".$real_pass."'"; $select_sql = mysql_query($select_user); $user_result = mysql_num_rows($select_sql); if($user_result > 0) { return true; } else { //return $error['invalid_attempt'] = 'User Id or Passowrd is worng!'; return false; } } // Getting session /*public function get_session() { return $U_id=$_SESSION['id']; $user_id=$_SESSION['user_id']; $userpass=$_SESSION['password']; }/*/////////get_session public function logout(){ //$_REQUEST['user_id']=FALSE; //$_REQUEST['password']=FALSE; session_destroy(); } } ?>