Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

show if user login

$
0
0
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['Admin'] == true) {
?>
<p>you are login</p>
<?php
} else {
?>
<p>ju are not login</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.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>