I'm trying to make a function that displays content depending on whether you are logged in or not.
have both pulled hair and looked around .. the closest I found is.
<?php
if ($_SESSION['isAdmin'] == true) {
?>
<p>Du är inloggad</p>
<?php
} else {
?>
<p>Du är inte inloggad</p>
<?php
}
?>
but I can not get it to work as I after looking fore
This is how the page look like now
<?php include($_SERVER['DOCUMENT_ROOT'].'/Connections/PhPdev.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Namnlöst dokument</title>
</head>
<body>
<?php
if ($_SESSION['isAdmin'] == true) {
?>
<p>My admin html</p>
<?php
} else {
?>
<p>My non-admin html</p>
<?php
}
?>
</body>
</html>
but I can not understand how I can get the fuktionen to work.