my website requires users to login and I want to allow some users to access more information than others. I use css display none property to set some of the items on the tab menu to not display depending who the user is. This way, they can’t click on the tab to display the info. Is this a good way to restrict access to some materials on the website? Is there a better way? I’m using javascript and php. Thanks.
Share
This is a terrible idea for many reasons, some reasons being:
-Any user like myself will often View Source your page and click around.
-How about people using a browser or setting that doesn’t display stylesheets?
-What about users sending or sharing links on Facebook etc..? They can just go to the page right away without logging in or having those permissions?
-Are webcrawlers indexing these pages and putting them in search results?
You need to do this on the back-end and disallow users, not just hide the content.