King King - 1 year ago 95
PHP Question

how to hide pages from unregistered users

I want to hide certain pages on my navigation bar for users that are not registered, not to see those certain pages. How can I accomplish this?

If a user is not registered, no access will be given to him or her on some pages on the website. I'm using PHP.

Meaning if you are not a registered member you will be limited on seeing some pages. Otherwise if you a member you have access to all the pages on the site.

Answer Source

I have accomplish this by adding the following code

if ($userid == "") {
    Header("Location: index.php");

This worked like a charm.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download