I have created a login script using a session. Anyone can log into the website but I want to make it so a particular link is only shown if the user has permission.

In the database, access is shown simply by a Y or N (for Yes or No). If the user has a Y in the field, I want them to see the link when they login.

Thanks for your help!

Recommended Answers

All 3 Replies

Do you know how to retrieve the Y or N value from the database?

Sounds like a job for an "if" statement to me.

if (1 == $login)
  {
  if (true == $see_link)
    {
    echo "Link";
    }
  else
    {
    // Do Nothing
    }
  }

Sounds like a job for an "if" statement to me.

if (1 == $login)
  {
  if (true == $see_link)
    {
    echo "Link";
    }
  else
    {
    // Do Nothing
    }
  }

Exactly :)

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.