943,660 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1091
  • PHP RSS
Jul 7th, 2006
0

Displaying a link based on permission

Expand Post »
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!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Unverified User
Eiolon is offline Offline
6 posts
since Apr 2005
Jul 8th, 2006
0

Re: Displaying a link based on permission

Do you know how to retrieve the Y or N value from the database?
Reputation Points: 10
Solved Threads: 0
Light Poster
KeithMcL is offline Offline
34 posts
since Oct 2004
Jul 8th, 2006
0

Re: Displaying a link based on permission

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

PHP Syntax (Toggle Plain Text)
  1. if (1 == $login)
  2. {
  3. if (true == $see_link)
  4. {
  5. echo "Link";
  6. }
  7. else
  8. {
  9. // Do Nothing
  10. }
  11. }
Reputation Points: 23
Solved Threads: 23
Posting Pro in Training
Puckdropper is offline Offline
494 posts
since Jul 2004
Jul 8th, 2006
0

Re: Displaying a link based on permission

Quote originally posted by Puckdropper ...
Sounds like a job for an "if" statement to me.

PHP Syntax (Toggle Plain Text)
  1. if (1 == $login)
  2. {
  3. if (true == $see_link)
  4. {
  5. echo "Link";
  6. }
  7. else
  8. {
  9. // Do Nothing
  10. }
  11. }
Exactly
Reputation Points: 10
Solved Threads: 0
Light Poster
KeithMcL is offline Offline
34 posts
since Oct 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: list box --php issue
Next Thread in PHP Forum Timeline: Need HELP in pagination (PHP)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC