Forum Moderators: coopster
<?php
//if the admin or a mod accesses this page, show the form
if ($_SESSION['logged_in'] == 1 && $_SESSION['username'] == "admin" ¦¦ $_SESSION['function'] == 1) {
echo '<h2>Write News</h2>';
echo '<form action="news_func.php" method="post">';
echo '<table>';
echo '<tr><td width="50px">Author: </td><td><b>'.$_SESSION['username'].' </b></td></tr>';
echo '<tr><td width="50px">Title: </td><td><input type="text" name="nform_title"></td></tr>';
echo '<tr><td width="50px">Text: </td><td><textarea name="nform_text" cols=40 rows=6></textarea></td></tr>';
echo '<input type="hidden" name="nform_date" value="'.date("F j, Y, g:i a").' ">';
echo '<input type="hidden" name="nform_author" value="'.$_SESSION['username'].' ">';
echo '<tr><td></td><td><input type="submit"></td></tr>';
echo '</table>';
echo '</form>';
} else {
//otherwise this user has no business here
echo 'Access denied';
}
?>
The strange thing is that if I cut out this bit of the IF statement:
&& ($_SESSION['username'] == "admin" ¦¦ $_SESSION['function'] == 1)
...then it works and displays the form.
Just as a test I even changed it to:
&& ($_SESSION['username'] == "admin" && $_SESSION['function'] == 1)
replaced the ¦¦ with && and it displayed the same error again.