Im having a problem with my code.
When I run it to php4 and it works fine. Then I tried it to php5. Im getting error -"Undefined Variable: _Session in ..."
<?php
session_start();
function logged_in() {
return isset($_SESSION['idnum']);
return isset($_SESSION['user_type']);
return isset($_SESSION['fname']);
}
function confirm_logged_in() {
if (!logged_in()) {
redirect_to("index.php");
}
}
function confirm_logged_in_admin() {
if (!logged_in()) {
redirect_to("admin.php");
}
}
function booking_restriction(){
if ($_SESSION['user_type'] == 4) {
redirect_to("home.php");
}
}
function confirm_if_admin() {
if ($_SESSION['user_type'] == 2 ||
$_SESSION['user_type'] == 3 ||
$_SESSION['user_type'] == 4 ) {
redirect_to("../home.php");}
}
?>