Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Server Side Programming > ASP and ASP.NET
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 10-20-2009, 12:02 AM
  #1
licketty_split
Novice (Level 1)
 
Join Date: Aug 2009
Posts: 7
iTrader: (0)
licketty_split is an unknown quantity at this point
Redirecting to login page if user is not logged in

hi I've created a webpage that can only be access be people who are logged in. When someone tries to navigate to it that isn't logged in, it should redirect to the login page. However, as I am using a custom SQL database for the users, I can't use the Web admin tool to do this. Anyone know who to do it?

Thanks
licketty_split is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-20-2009, 05:54 AM
  #2
JosephJames
Fighter (Level 4)
 
Join Date: Aug 2009
Posts: 37
iTrader: (0)
JosephJames is an unknown quantity at this point
You can use Response.Redirect function to redirect to a page.
JosephJames is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-21-2009, 08:42 AM
  #3
kirank
Aspirant (Level 2)
 
kirank's Avatar
 
Join Date: Aug 2009
Location: in World
Posts: 15
iTrader: (0)
kirank is an unknown quantity at this point
if you are using classic asp then
Code:
sql = "select id,pass from user where userid='"& userid&" and password='"&pass&" ' '"
rs.open sql,conn
if rs.Eof then 
 response.write "Welcome" &userid
 response.redirect("welcomepage.asp")
else
  response.redirect("login.asp")
end if
hope it will help you .

same thing on .Net just change the syntax
kirank is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  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
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 11:07 PM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.