laura301019 0 Newbie Poster

ive got a webpage that has a login page, it displays the 3 users name and then gives the fields to login. When the user logs in they get to vote for 3 people to be 1st 2nd and 3rd. I have to change the following code so that on the login page it will only display the users who have not voted.

// 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 ";

i know it tells me how to do it but do i keep the if statement already in the code or do i have to write a new one? I have many files for this so not much point in asking what i get it to be equal to (which i can't figure out anyways).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.