Access level login with php

View previous topic View next topic Go down

Access level login with php

Post by r_kelly on Sun Nov 27, 2016 1:58 pm

<?php

session_start();
if(!isset($_SESSION['user']))
{
$_SESSION['student_id'] = 0;
$_SESSION['access'] = 0;
}

$user = $_POST['username'];
$pass = $_POST['password'];


$mysqli = new mysqli("localhost","root","","marks");
$res = $mysqli->query("SELECT student_id,accessLevel FROM user WHERE email = '".$user."' AND password = '".$pass."'");


if($row = $res->fetch_assoc())
{
$_SESSION['student_id'] = $row['student_id'];
$_SESSION['access'] = $row['accessLevel'];
}
else
{

}

?>

r_kelly
Admin

Posts : 2
Join date : 2016-11-27

View user profile http://codeaccess.africamotion.net

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum