-
Notifications
You must be signed in to change notification settings - Fork 0
/
methods.php
46 lines (43 loc) · 1.28 KB
/
methods.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
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
if(is_session_started()==FALSE){
session_start();
}
// function login(){
// $_SESSION["hms_login"] = true;
// $_SESSION["hms_login_fname"] = $fname;
// $_SESSION["hms_login_lname"] = $lname;
// $_SESSION["hms_login_email"] = $email;
// $_SESSION["hms_login_gender"] = $gender;
// }
function secure($str){
require("conn.php");
$str = mysqli_real_escape_string($con,$str);
return $str;
}
function islogin(){
if(isset($_SESSION["hms_login"])){
return true;
}
/**if($_SESSION["hms_login"]){
foreach($_SESSION as $key=>$val){
if($val==""){
echo $val;
return false;
}
}
return true;
}**/
return false;
}
function is_session_started()
{
if ( php_sapi_name() !== 'cli' ) {
if ( version_compare(phpversion(), '5.4.0', '>=') ) {
return session_status() === PHP_SESSION_ACTIVE ? TRUE : FALSE;
} else {
return session_id() === '' ? FALSE : TRUE;
}
}
return FALSE;
}
?>