Jump to content

wanna comments what is done from these php and html key words


pasan4you

Recommended Posts

<?phprequire_once 'config.php'; //calls to config.php $login_username = $_POST['login_username'];//getting user name $login_password = $_POST['login_password'];//getting password $conn = new PDO('mysql:host='.DB_HOST.';port='.DB_PORT.';dbname='.DB_NAME,DB_USER,DB_PASS);//connecting to databse $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); try { $sql = 'SELECT login_username, login_password, login_group FROM login WHERE login_username=:login_username'; $stmt = $conn->prepare($sql); $stmt->execute(array(':login_username' => $login_username)); $result = $stmt->fetchAll(); if ( count($result) ) { $row = $result[0]; $_SESSION['login_username']= $row['login_username']; $_SESSION['login_group']= $row['login_group']; $_SESSION['info'][] = "Welcome to Leave Management System Of IDM University College ! "; } else { $_SESSION['info'][] = "Please check your user name and password!"; } } catch (Exception $ex) { $_SESSION['info'][] = "Login Error !"; } header("Location: ".$_SERVER['HTTP_REFERER']); ?>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...