How to change the elements in the page base on user who is logged in
Posted
by user225269
on Stack Overflow
See other posts from Stack Overflow
or by user225269
Published on 2010-05-25T09:58:56Z
Indexed on
2010/05/25
10:01 UTC
Read the original article
Hit count: 126
php
Please give me an idea on how to display elements in a page depending on who is logged in. For example, a user or an administrator. I'm thinking of something like this but I get a parse error, what do I lack in this code?:
<?php
session_start();
if (!(isset($_SESSION['loginAdmin']) && $_SESSION['loginAdmin'] != '')) {
header ("Location: loginam.php");
}
if else (!(isset($_SESSION[['loginAdmin']) && $_SESSION['loginAdmin'] =='')) { ?>
<?php include('head2.php'); ?>
}
<?php
if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) {
header ("Location: login.php");
}
if else (!(isset($_SESSION[['login']) && $_SESSION['login'] =='')) { ?>
<?php include('head3.php');
}
?>
Please help
© Stack Overflow or respective owner