-
Notifications
You must be signed in to change notification settings - Fork 1
/
core.inc.php
33 lines (32 loc) · 907 Bytes
/
core.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
ob_start();
session_start();
require 'connect.inc.php';
$current_file=$_SERVER['SCRIPT_NAME'];
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 mysql_result($query_run, $number, $field=0) {
mysqli_data_seek($query_run, $number);
$row = mysqli_fetch_array($query_run);
return $row[$field];
}
function getuserfield($field){
$query = "SELECT `$field` FROM `users` WHERE `id`='".$_SESSION['user_id']." ' ";
global $conn;
if($query_run=mysqli_query($conn,$query))
{
if($query_result = mysql_result($query_run, 0, $field)){
return $query_result;
}
}
}
?>