Hi all,
I have seen this in many sites, we could not access certain links unless we login... I don't have any idea about this, could anyone tell me what is the logic behind this...:)
once you have your log in set up, you would do something simple like this...
if ($_SESSION['loggedin'] == "yes") { echo "<a>link</a>"; }
This is like we are introducing some links after logging in...but what i actually mean is, the link should be there but it should not be active for guests...
than add an else statement
if ($_SESSION['loggedin'] == "yes") { echo "<a>link</a>"; } else { echo "link"; }
Let me try this out in my script...
coldwerturkey;10897908 wrote:than add an else statement if ($_SESSION['loggedin'] == "yes") { echo "<a>link</a>"; } else { echo "link"; }
but i can copy this link 🙂
djjjozsi wrote:but i can copy this link
but i can copy this link
You'll only be copying the link text though, but then a logged in user will not be able to go anywhere either 🙂
But that's a good point: another check should be performed at the page that is linked to.