473,605 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to restrict access to admin pages

41 New Member
hi

i am working on admin section which has a login page with login id and pasword form.
in my admin section i have many pages say like manage_products .php, description.php , user.php etc.

if i have to access the manage_products .php page then i can access it just typing like the link below

http://localhost/vineet/admin/manage_products .php

without entering login user and pasword.

i want to restrict the access of this page through admin panel only. No one should able to access any of the page by typing the url directly. how is it possible.

vineet
Oct 26 '08 #1
4 11380
Markus
6,050 Recognized Expert Expert
hi

i am working on admin section which has a login page with login id and pasword form.
in my admin section i have many pages say like manage_products .php, description.php , user.php etc.

if i have to access the manage_products .php page then i can access it just typing like the link below

http://localhost/vineet/admin/manage_products .php

without entering login user and pasword.

i want to restrict the access of this page through admin panel only. No one should able to access any of the page by typing the url directly. how is it possible.

vineet
You need to write a login page which would compare the user give data against a database of admin credentials. If they matched, set a cookie or a session saying the user has permission to access restricted pages. On restricted pages check if a cookie/session is set to allow them access.

Google
Oct 26 '08 #2
pedalpete
110 New Member
another way to go is to use apache and an access file.
Depends on what you want to do. I think if the admin pages are just for you and a few others, the database login route may be overkill.

check out this link
http://www.yolinux.com/TUTORIALS/LinuxTutorialAp acheAddingLogin SiteProtection. html
Oct 27 '08 #3
zabsmarty
25 New Member
for this you will be take a session ID or session varaible from admin so when you will login as admin then store admin id or any variable in session variable and on top of each page check that if this variable is empty then go for login .

for examle:

Expand|Select|Wrap|Line Numbers
  1.  
  2. if(!isset($_SESSION['adminemail']))
  3. {
  4. header("location:login.php');
  5. exit();
  6. }
  7.  
  8.  
hope you will be unserstand.
Thanks
Oct 28 '08 #4
Markus
6,050 Recognized Expert Expert
for this you will be take a session ID or session varaible from admin so when you will login as admin then store admin id or any variable in session variable and on top of each page check that if this variable is empty then go for login .

for examle:

Expand|Select|Wrap|Line Numbers
  1.  
  2. if(!isset($_SESSION['adminemail']))
  3. {
  4. header("location:login.php');
  5. exit();
  6. }
  7.  
  8.  
hope you will be unserstand.
Thanks
Again, like I have already suggested.
Oct 28 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3123
by: Paul | last post by:
Hi all, at present I I've built a website which can be updated by admin and users. My problem, I've combined "log in" and "access levels" to restrict access to certain pages, using the built in "log in" and "user authentication, restrict access to page" features. But I find the after login I constantly get redirected from the restricted pages.
4
1815
by: Ove | last post by:
I have one Access 2000 DB on my website. I want to access these tables from my local database so i do not need to down-/upload the database each time i want to make changes. Meanwhile i want a external partner to access (just read) another database on my web. I have tried with "link tables" but do not succeed. Help please! /Ove H,
1
3329
by: com | last post by:
Extreme Web Reports 2005 - Soft30.com The wizard scans the specified MS Access database and records information such as report names, parameters and subqueries. ... www.soft30.com/download-1-11975.htm - 31k - Cached - Similar pages MDBSecure 1.0.8.0 - Soft30.com Utility which makes it easy to create secure MS Access Databases, ... MS Access 2000/2003 format. 30 day money back guarantee, 30 day trial. ...
19
2319
by: ree32 | last post by:
We have an intranet setup but when you try and connect from outside the network using a windows login & the internet the ASP.net pages (.aspx) on the intranet will not load but the old asp pages (.asp) load. Whats more frustrating is the fact eventhe errors will not show, I have even tried to change the customerrors to "off" from "remote only", and still it won't show the errors. So does anyone have an idea as to what is causing this...
1
1311
by: thavaht | last post by:
I’ve been searching on the forum and don’t seem to find a post that matches my question: I need to restrict access to some php pages on a web site to computers on the same domain or local network, without using password. Can any one help with code?
1
2954
by: Mubs | last post by:
Hi PPL, On my website i have setup user log in. once they log in i want to restrict certain users from certain pages.. and on some pages i want the user to enter their username and password again..but i am stuck on how to restrict them.. any user guides on how to tackle this issue..i am using dreamweaver cs3 many thanx
1
3530
by: Chase Kang #52 | last post by:
I have a web application using custom authentication and role management, which seems to work properly. I also have a web config file with the following: <location path="systems"> <system.web> <authorization> <allow roles="Administrator,Reader" /> <deny users="*" /> </authorization>
17
4789
by: yuvang | last post by:
Hi all I have a mdb with login name and password form. There are several login names, i defined through a table "User_login". Here the problem is at a time a single user is able to login in multible system, which i want to restrict. here is the code which i i am using for login check..... Private Sub cmblogin_Click() Static intlogonattempts As Integer
2
2329
by: beyrself | last post by:
Hi, i've created a application using microsoft visual studio 2005. I've publish the exe application using IIS. now is issue is. I need to restrict the login part. For example is A login to this website.. B cant login until A log off. I'm using VB.net BTW! Below is the code for my login page. Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click If UsernameTextBox.Text = "admin" And...
0
7934
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8424
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8069
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6742
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5445
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3958
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2438
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1537
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.