Commit 80675e40 authored by Maneesha Fernando's avatar Maneesha Fernando Committed by GitHub

Delete verify.php

parent 3130c9c9
<?php
//if (session_status() !== PHP_SESSION_ACTIVE) {session_start();}
if(session_id() == '' || !isset($_SESSION)){session_start();}
include 'config.php';
$username = $_POST["username"];
$password = $_POST["pwd"];
$flag = 'true';
//$query = $mysqli->query("SELECT email, password from users");
$result = $mysqli->query('SELECT id,email,password,fname,type from users order by id asc');
if($result === FALSE){
die(mysql_error());
}
if($result){
while($obj = $result->fetch_object()){
if($obj->email === $username && $obj->password === $password) {
$_SESSION['username'] = $username;
$_SESSION['type'] = $obj->type;
$_SESSION['id'] = $obj->id;
$_SESSION['fname'] = $obj->fname;
header("location:index.php");
} else {
if($flag === 'true'){
redirect();
$flag = 'false';
}
}
}
}
function redirect() {
echo '<h1>Invalid Login! Redirecting...</h1>';
header("Refresh: 3; url=index.php");
}
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment