Access level login with php
Page 1 of 1
Access level login with php
<?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
{
}
?>
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
{
}
?>
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|