I have a webpage that allows 3 users to login and vote, at the login page it displays the 3 users however ive to change the following code so that at the login page it will only display the users who haven't voted yet. What do i need to change in the loop?
<?php
// change this loop to only display those users who have not yet voted
echo "<p><span class=\"bold\">Users available:</span><br />";
foreach ($users as $user=>$password) {
if (!isset($_SESSION["$users"]))
{
// test to see if a user has already voted before echo-ing to screen
// by checking if the value of $_SESSION["user"] is equal to "voted" (1a)
echo "$user ";
}
echo "</p>";
}
$message="";
if (isset($_GET["failCode"]) && $_GET["failCode"]==1) {
$message="<p><span class=\"loginMessage\">".
"Bad username entered</span></p>";
}
if (isset($_GET["failCode"]) && $_GET["failCode"]==2) {
$message="<p><span class=\"loginMessage\">".
"Wrong password entered</span></p>";
}
echo "$message";
?>