<?php
ob_start();
session_start();
$current_file = $_SERVER['SCRIPT_FILENAME'];

if(isset($_SERVER['HTTP_REFERER']) && !empty($_SERVER['HTTP_REFERER'])){
    $http_referer = $_SERVER['HTTP_REFERER'];
}

function loggedin(){    
    if (isset($_SESSION['user_id']) && !empty($_SESSION['user_id'])) {
        return true;
    } else {
        return false;
    }
}

function getuserfield($field){
    global $con;
    $query = "SELECT `$field` FROM `globaly_accounts` WHERE `id`= '" . $_SESSION['user_id']. "'";
    if($query_run = mysqli_query($con,$query)){
        $row = mysqli_fetch_assoc($query_run);
        return $field = $row[$field];
    }
}
?>
