Is it possible to check on the click of a link (html) whether a php session has been set? I am trying to stop a link being clicked should a user not be logged in. Thanks
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you’ve got your logical sequence of events mixed up. You check the existence of a php session before the page is even served.
Once a link is on the page you cannot directly prevent it from being used, unless you add an on-click listener or handle it with javascript.