Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 admin control panel
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

quince
Junior Member

Canada
103 Posts

Posted - 12 January 2005 :  09:09:35  Show Profile
hello everyone...
i have done on my website an administrator login so the administrator is the only person who can login ...the way, is to insert a username and password and to check it is in the database and if it is correct take him to the control panel and if it is not return an error message ... but i am facing a serious problem where anyone can go to the control panel or any page of those for the admin stuff only by entering the link directly ... so i need a way which it will not let me see those pages till i login ...
i heard it works with the cookies ... but i am not sure ...

waiting for your replies guys ....
quince

muzishun
Senior Member

United States
1079 Posts

Posted - 12 January 2005 :  11:16:03  Show Profile  Visit muzishun's Homepage
It can indeed be done with cookies. Check out the tutorial on ASP cookies over at w3schools. That's what I use to check the logins on my site that aren't Snitz related.

I think it can also be done using Sessions, but I don't really know how to use them, so I personally go for the cookie route.

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

quince
Junior Member

Canada
103 Posts

Posted - 13 January 2005 :  14:50:32  Show Profile
hello everyone ... i had tried and tried to do it and at last i have done it by using the cookies ...
so i am gonna put what i have done so if anyone want to do as what i have done

first u need three pages: first page for the login form which is done by html (admin.asp) and the second page which will check if the username and password enetered are in the database (auth.asp) and the third is the control panel for the administrator(control.asp)

when rhe admin enter his username and password in the admin.asp he will go to the auth.asp to check if it is right or not so if yes it will redirect him to control.asp if it is not it will take him back to admin.asp
now we will add to auth.asp the assigning cooky we will enter it as follow

If Not rst.EOF Then
Response.cookies("user1") = Request.form("user")
response.redirect("control.asp")
else
response,redirect("admin.asp")

now we will go to the control panal and we will retrieve the cooky and we will do as follow

<%
admin = request.cookies("user1")
if admin <> "" then
%>
'here you can write ur html code if it is or u can continue with the asp
<%
else 
response.redirect("admin.asp")
end if
%>

so with this code in the control.asp it will check in the cooky file if it is empty it will take me back to the admin.asp and if it is not empty it will open the page ...

i wish i had helped others with my topic .. see you guys
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.35 seconds. Powered By: Snitz Forums 2000 Version 3.4.07