I made a login for my site using dreamweaver's toolset which works like a charm. After a successful login the user is directed to the site's homepage.
Here I'm trying to insert a message that will only display for users with a certain access level. Normal users are assigned the value 'member' in the database table and admins are assigned 'admin'.
On my homepage I inserted the following into my top php code:
<?php
if (isset($_POST['user']))
{
mysql_select_db($database_cliche, $cliche);
$loginUsername=$_POST['user'];
$password=$_POST['password'];
$output = mysql_query("SELECT niveau FROM User WHERE username = $loginUsername");
$_SESSION['MM_fldUserAuthorization'] = mysql_result($output);
$MM_redirectLoginFailed = "denied.php";
$MM_redirecttoReferrer = false;
?>
And in my html body I attempt to display the message using an if statement:
<body>
<div class="wrap"><img src="main_back1.png" width="800" height="225" /></div>
<div class="navi"></div>
<div class="content">
<div class="content2">
<p>hello</p>
<p><?php
if ($_SESSION['MM_fldUserAuthorization'] == 'admin') {
echo 'Admin logged in';
}
?>
</p>
</div>
<div class="info_bot">| company info |</div>
</div>
<div class="bottom"><?php echo $_SESSION['MM_Username']; ?></div>
</body>
</html>
<?php
mysql_free_result($rs_user);
?>
However im getting an error saying syntax error, unexpected $end ... on line 255, which is the very last line of my html body I show above.
What am I doing wrong?