p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 1st, 2006, 07:43 AM
Registered User
 
Join Date: May 2006
Location: belfast, , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Admin login help

Hi guys first post here but long time visitor, i have been building an asp website for a highschool project, and this forum has been a god send and has helped me greatly, however there is one aspect of my asp that im having trouble with and that is with the admin login.

at the moment i have a session login for every user that redirects them to a page called Groups.asp,

it works like this, user starts of at index.asp --> username and password or then passed onto check_user.asp

check_user.asp ----> checks the users login against the database info & if correct sends them to Groups.asp

login code can be seen below



If thisRecordset("Password") = Request.Form("Password") Then
                username = request.Form("StudentID")
                session("thisusername") = username
                session("cust_passed") = true
                Response.Redirect "Group.asp"



I also have the following code in each page to ensure users are logged in before they can view the page.

<%if session("cust_passed") = false then%>
    <p><%Response.Redirect("index.asp")%>


however on my site i have a navigation header that has an admin button on it, which at the moment every user can access just by clicking on it.

would it be possible to just redirect administrator straight to the admin section when they login? in which case i could just remove the admin button from the navigation and it wouldnt really matter about other people accessing the page as they wouldnt have any direct link to it.

if any other information is needed please say

cheers in advance

Banned
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old May 8th, 2006, 05:34 AM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi banned

First thing you have to do is to add a field to your "Users" Table ,"level" for instance . Then for every user you can specify whether the user is an "admin" or not.

Then when the user logs in, you check the level field , if it's "admin" then redirect the user to admin's control panel, else redirect them to another page .

BTW why not writing the code with wich you check a user as a function and calling it on every page ?
It's more flexible and secure . You don't have to change it one by one on every page whenever there's a change in codes .

Hope it helps :)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old May 8th, 2006, 08:50 PM
Registered User
 
Join Date: May 2006
Location: belfast, , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi Kati thanks for the reply, that sounds very interesting i will look into it and let you know the results

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to redirect an non-registered admin to login nrlahoti ASP.NET 2.0 Professional 4 November 26th, 2007 08:47 AM
CMS - admin login does not work peppie BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 2 October 20th, 2007 09:46 AM
I can't login admin account all chapter ? pop99 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 June 4th, 2006 06:17 AM
admin login mujnu PHP How-To 0 February 5th, 2006 08:03 AM
can't login into PHPNuke as admin anshul Pro PHP 0 August 5th, 2004 05:16 AM



All times are GMT -4. The time now is 07:23 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc