Access in php site

Hello friends I am new in php ,and i am making a website ,that has users and admin access module. But i don’t know how can i do it.
I want to give some page access to users and all for users.Can any one help me.:frowning:

So the admins will need to log in? If so you could have a database that you query when the log in form is submitted. If succesfuls a session will be set for that user. Now when a user tries to access a page that only admin members can access a check is run to see if that session is set. If it is the user can view the page, if not they are redirected somewhere else.

This is the most basic route to go down. What have you tried already? Have you written any code?

You are trying to make a User Authentication system in your site?
My advice is you don’t need to re-invent the wheel.
Just google “PHP Login class” or “PHP User authentication class”.

Or if you are new to PHP.
Just google “PHP Login tutorial” or “PHP User authentication tutorial”.

Good Luck!

I would recommend using Symfony 2 to build your application. You get a very flexible authentication and authorization toolset and many more great things without reinventing the wheel instead standing on the shoulders of giants and a large community for support. Not to mention you can start off out of the gate learning important software design priniciples such as; object-oriented programming (oop), separation of concerns, dependency management, code reuse, etc.

Thanks friend ,it helped me a lot …

If you are going to use a framework I would use http://laravel.com/. In my opinion it is the best PHP framework out there, but you are new to PHP so I would code everything from scratch for the experience.

Don’t start with a source if you know nothing about it. Start reading some tutorials on Youtube and when you know more about it, you can do it on your own :wink: