Hi,
I am new to PHP and currently trying to develop a website. I have a few sections (pages) where Users must insert a Username and password to gain access to other pages. i want to use PHP for doing that.
e.g. loginstaff.htm - user has to enter Username & Password (this is being validated by a php script in login.php) to access staff.htm. I need the user to enter the proper Username & password used when registering and restrict any other people/user to type the URL directly (e.g. www.site.com/staff.htm).
Thanks
Munnabhaai
User Access In PHP
Moderator: General Moderators
Re: User Access In PHP
What do you have so far? What problems are you encountering?
Re: User Access In PHP
First of all, in order to use PHP, you need to eliminate staff.htm and replace it with staff.php, which will contain all the html from staff.htm, but will have additional PHP code to control the access, etc. At least, I think that's the most obvious and efficient approach. So staff.php will initially present the user with a login form that has action='', which sends the Post form data back to the same script, which can then validate the login credentials against the database and either deliver the desired HTML or return the notice that the login was unsuccessful.Munnabhaai wrote:Hi,
I am new to PHP and currently trying to develop a website. I have a few sections (pages) where Users must insert a Username and password to gain access to other pages. i want to use PHP for doing that.
e.g. loginstaff.htm - user has to enter Username & Password (this is being validated by a php script in login.php) to access staff.htm. I need the user to enter the proper Username & password used when registering and restrict any other people/user to type the URL directly (e.g. http://www.site.com/staff.htm).
Thanks
Munnabhaai
-
Munnabhaai
- Forum Newbie
- Posts: 2
- Joined: Thu Jul 14, 2011 8:25 am
Re: User Access In PHP
califdon
thanks will start doing that and get back for more questions that i may have.
Thanks
thanks will start doing that and get back for more questions that i may have.
Thanks