I have a small site which has 200 members. Below is code for the login/logout links which display a "Change Password", "Report" and "Logout" link when logged in. While not logged in, the "Login" and "Forgot password" links are displayed.
Recently we ran a competition which had 14 winners and what I am trying to achieve is to put a link into the code that only the 14 winners can see and not the remaining members.
I'm not quite sure where to start, is it possible to put a condition in this code for the 14 user ids/email addresses or would I be better off putting a new field into the user's database? Any help or push in the right direction would be appreciated!
<?php # loginnav.php>
// Display links based upon the login status.
// Show LOGIN links if this is the LOGOUT page.
if (isset($_SESSION['user_id'])
AND (substr($_SERVER['PHP_SELF'], -10)
!='logout.php'))
{ echo
'<li><a href="logout.php">Logout</a></li>
<li><a href="change_password.php">Change Password</a></li>
<li><a href="report.php">Report</a></li>
'; } else {
// Not logged in.
echo
' <li><a href="login.php">Login</a></li>
<li><a href="forgot_password.php">Forgot Password?</a></li>
'; } ?>