forked from nandishkotadia/JP-code-for-good-hackathon
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcore.inc.php
More file actions
45 lines (39 loc) · 697 Bytes
/
core.inc.php
File metadata and controls
45 lines (39 loc) · 697 Bytes
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
34
35
36
37
38
39
40
41
42
43
44
45
<?php
require 'connect.inc.php';
ob_start();
session_start();
//echo $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 getfield($field)
{
//echo $_SESSION['user_id'];
//echo $field;
$query = "SELECT `$field` FROM corp_reg WHERE `id`='".$_SESSION['user_id']."'";
if($query_run = mysql_query($query))
{
if($query_result = mysql_result($query_run, 0, $field))
{
return $query_result;
}
}
else
{
//echo 'hello';
}
}
?>