Displaying a link based on permission

Reply

Join Date: Apr 2005
Posts: 6
Reputation: Eiolon is an unknown quantity at this point 
Solved Threads: 0
Eiolon Eiolon is offline Offline
Newbie Poster

Displaying a link based on permission

 
0
  #1
Jul 7th, 2006
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!
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 34
Reputation: KeithMcL is an unknown quantity at this point 
Solved Threads: 0
KeithMcL's Avatar
KeithMcL KeithMcL is offline Offline
Light Poster

Re: Displaying a link based on permission

 
0
  #2
Jul 8th, 2006
Do you know how to retrieve the Y or N value from the database?
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 494
Reputation: Puckdropper is an unknown quantity at this point 
Solved Threads: 21
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: Displaying a link based on permission

 
0
  #3
Jul 8th, 2006
Sounds like a job for an "if" statement to me.

  1. if (1 == $login)
  2. {
  3. if (true == $see_link)
  4. {
  5. echo "Link";
  6. }
  7. else
  8. {
  9. // Do Nothing
  10. }
  11. }
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 34
Reputation: KeithMcL is an unknown quantity at this point 
Solved Threads: 0
KeithMcL's Avatar
KeithMcL KeithMcL is offline Offline
Light Poster

Re: Displaying a link based on permission

 
0
  #4
Jul 8th, 2006
Originally Posted by Puckdropper
Sounds like a job for an "if" statement to me.

  1. if (1 == $login)
  2. {
  3. if (true == $see_link)
  4. {
  5. echo "Link";
  6. }
  7. else
  8. {
  9. // Do Nothing
  10. }
  11. }
Exactly
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC