CasperSecurity

Current Path : /var/www/acasv2.uiet.co.in/backup/aca.uiet.co.in/aca.uiet.co.in/functions/
Upload File :
Current File : /var/www/acasv2.uiet.co.in/backup/aca.uiet.co.in/aca.uiet.co.in/functions/loginvalidate.php

<?php
	session_start();
	include'../includes/dbconnection.php';
	
	$username = trim($_POST['username']);
	$password = trim($_POST['password']);
	
	//Through this connection DB will be not busy when 1000s of user works at a time.
	$connection = new createConnection();
	$connection->connect();

	$query = "SELECT * FROM  user WHERE user_login_id = '$username' AND password = '$password'";
	$result = mysqli_query($connection->myconn, $query);

	if($numrows = mysqli_num_rows($result)){
		while ($user = mysqli_fetch_assoc($result)){
			if($user['is_active'] != 1){
				$_SESSION['ERROR_MSG'] = "You are not an Active User" ;
				$connection->close();
				header('location:'.$_SERVER['HTTP_REFERER']);
			}else{
				$_SESSION['userId'] = $user['user_id'];
				//$_SESSION['ADMIN'] = $user['user_id'];
				$_SESSION['userOrgUnitId'] = $user['organisation_unit_id'];
				$_SESSION['userName'] = $user['user_name'];
				$_SESSION['userActiveFrom'] = strtotime($user['created_on']);
				$_SESSION['userActive'] = $user['is_active'];
				$connection->close();
                if(isset($_SESSION['ERROR_MSG'])){
                    unset($_SESSION['ERROR_MSG']);
                }
				header('location:../app/');
			}
		}
	}else{
		$_SESSION['ERROR_MSG'] = "Invalied User Name or Password";
		$connection->close();
		header('location:'.$_SERVER['HTTP_REFERER']);
	}
	


?>
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY