Please Help me



 I am new to PHP and i do need some help.

i have one index.php page, it contains welcome message and few links to other php pages for storing data in db and showing value from db.

And i have login.php page which performs admin verification.

And i have also some other pages for different admin functions.

      I have to ask that, when a user want to access index.php page or other page,  the login.php page should open first , and after verification of user index and other pages should be opened.

       I think it will be done with Session management but i don't know how to implement it? 



Yes sessions would be your best bet on this one.

Check into this to get a good jump on it. On tip I can give you is don’t be overwhelmed by sessions. They are actually pretty simple. I just kept trying to make it harder than it was.

Once you have read up on them and if you are still having trouble then write back and let us know what we can do for ya! :)


You probably want to have an include that checks the security (stored in COOKIES or SESSION) as an include - and just include this at the top of every page you want to protect.

If the person’s sessioned or cookied login info is good, then it just passes through that page.

If they aren’t good (not logged in, bad pass, etc) then redirect them to a log in page.

So at the top of your index page, have an include to a page with your security check, and if it’s bad, redirect to your login page - otherwise, just let them in.


Lot of thanks.

    i have studied various session tutorials and i have also implemented the sessions in my pages.

Once again thanks for your help.