Print Page | Close Window

Can you help me?

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=3475
Printed Date: 29 March 2026 at 1:47pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Can you help me?
Posted By: jcjc
Subject: Can you help me?
Date Posted: 12 June 2003 at 9:20am

Hello:

I'm trying to do this:I have an access db with login, password and a personal url for each user. I use dreamweaver ultradev.

I want that if I put name1 , password1 this redirect to personalurl1

name2 , password2 this redirect to personalurl2

I don't know how to do this , can you help me?

I apologize for my english, only speak spanish. Thank you.

This are the names of the fields in the recordset

The table is named "usuarios"

{RcLogin.User}

{RcLogin.Password}

{RcLogin.url}

 

 




Replies:
Posted By: Scotty32
Date Posted: 12 June 2003 at 9:43am

am not sure how you do it in dreamweaver

but you would do something along the lines of

.......open database......

if request.form("user") = rs("user") then

if request.form("password") = rs("password") then

Response.Redirect( rs("url") )

else

response.redirect("login.asp?error=password")

end if

else

response.redirect("login.asp?error=username")

end if

 

if you already have sent it up, just use the response.redirect( rs.("url") ) and it will send them to the page you want them to go to

hope that helps



Posted By: jcjc
Date Posted: 12 June 2003 at 9:53am

Doesn't work :((

This is my login.asp page:

 

<mailto:%@LANGUAGE="VBscript"%'>%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/Conn.asp" -->
<%
set RcLogin = Server.CreateObject("ADODB.Recordset")
RcLogin.ActiveConnection = MM_Conn_Habilitados_STRING
RcLogin.Source = "SELECT *  FROM Usuarios  "
RcLogin.CursorType = 0
RcLogin.CursorLocation = 2
RcLogin.LockType = 3
RcLogin.Open()
RcLogin_numRows = 0
%>
<%
if request.form("user") = rs("user") then

if request.form("password") = rs("password") then

Response.Redirect( rs("url") )

else

response.redirect("login.asp?error=password")

end if

else

response.redirect("login.asp?error=username")

end if
%>

<html>
<head>
<title></title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="">
  user  <input type="text" name="user">
  password  <input type="text" name="password">
  <input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
<%
RcLogin.Close()
%>

 

 

AND this is the reported error

Tipo de error:
Error de Microsoft VBScript en tiempo de ejecución (0x800A000D)
No coinciden los tipos: 'rs'

Than you for spent your time with this

 



Posted By: Mart
Date Posted: 12 June 2003 at 10:06am

if request.form("user") = rcLogin("user") then

if request.form("password") = rcLogin("password") then

Response.Redirect(rcLogin("url"))

else

response.redirect("login.asp?error=password")

end if

else

response.redirect("login.asp?error=username")

end if



Posted By: jcjc
Date Posted: 12 June 2003 at 10:26am

Ok It was a mistake but...

with the last code ...login.asp is not showed...

this is the error message in netscape: "Redirection limit for this url exceeded.Unable to load the requested page."

In IExplorer is waiting, waiting, waiting..and the page is not showed

Sorry I think I'm very stupid :(((

Thank you

 



Posted By: Scotty32
Date Posted: 12 June 2003 at 11:54am

ok, try this

(if this isnt your form page take out the green)


<
mailto:%@LANGUAGE="VBscript"%'>%@LANGUAGE="VBSCRIPT"%>
<% if request.form("login") = "yes" then %>
<!--#include file="Connections/Conn.asp" -->
<%
set RcLogin = Server.CreateObject("ADODB.Recordset")
RcLogin.ActiveConnection = MM_Conn_Habilitados_STRING
RcLogin.Source = "SELECT *  FROM Usuarios  "
RcLogin.CursorType = 0
RcLogin.CursorLocation = 2
RcLogin.LockType = 3
RcLogin.Open()
RcLogin_numRows = 0

Dim strError, strURL

if request.form("user") = rcLogin("user") then

if request.form("password") = rcLogin("password") then

strError = "no"
strURL = rcLogin("url")

else

strError = "yes"

end if

else

strError = "yes"

end if

RcLogin.Close()
set RcLogin = nothing

if strError = "no" then

         response.redirect( strURL )

end if

end if
%>

<html>
<head>
<title></title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<% if strError = "yes" then response.write("There was a problem with your username or password. Please try again") end if%>
<form name="form1" method="post" action="">
  user  <input type="text" name="user">
  password  <input type="text" name="password">
  <input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>

< language=>


Posted By: jcjc
Date Posted: 12 June 2003 at 12:47pm

mmm well...something is working...

my page is login.asp but with this lines:

<% if request.form("login") = "yes" then %>
and the other
end if

doesn't work only the same page with good or bad login datas

But if I take out this is the answer with a good login

http://localhost/work/www.yahoo.com#http://www.yahoo.com - http://localhost/work/www.yahoo.com#http://www.yahoo.com #

The field in de access data base is hiperlink is this correct??

Oh thanks a lot you are working very good thanks!!

 

 



Posted By: Scotty32
Date Posted: 12 June 2003 at 12:50pm

< language=> yeah sorry

i forgot to put in a hidden field

right, if you put in a hidden:

<input type="hidden" name="login" value="yes">

now, this will only do the login process if the form has been submitted

does it work?



Posted By: jcjc
Date Posted: 12 June 2003 at 1:30pm

it's working!!!!!

guau!!

Now the only thing I have to try is the field url

If I put a html file into the directory of the database work the log in

I'm going to put directories and try

thanks!!!

All lot of thanks!!!

gracias!!!




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net