I have problem with my code. I have this code:
<?php include "../config.php"; ?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Title</title>
<link rel="stylesheet" href="../style.css" type="text/css" />
</head>
<? if (!empty($_SESSION['LoggedIn'])) { ?>
<div class="row">
<div class="span2">
<p><h3>Welcome <?=$_SESSION['login']?> loggedin: <?=$_SESSION['LoggedIn']?></h3> </p>
</div>
</div>
<br>
<div class="row">
<div class="span2">
<h1>Menu</h1>
</div>
<div class="span5">
<h2>Header1:</h2>
</div>
</div>
<?
} else {
?>
<h1>Error</h1>
<?
}
?>
</div>
</body>
</html>
The result is:
Welcome admin loggedin: 1
Menu
Header1:
Error
Why error???
Where I have mistake? I think that all bracket is good. Maybe it can be problem with my localhost??? Or I dont know. Can you give me advice?
<? ... ?>being parsed?<?instead of<?php. Check if PHP is configured to use short tags, or just don't use them.$_SESSION. IMO, the problem is elsewhere; the OP hasn't put in the entire code in here.