Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Can you help me?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Can you help me?

 Post Reply Post Reply Page  12>
Author
jcjc View Drop Down
Newbie
Newbie


Joined: 12 June 2003
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcjc Quote  Post ReplyReply Direct Link To This Post Topic: Can you help me?
    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}

 

 

Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
jcjc View Drop Down
Newbie
Newbie


Joined: 12 June 2003
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcjc Quote  Post ReplyReply Direct Link To This Post Posted: 12 June 2003 at 9:53am

Doesn't work :((

This is my login.asp page:

 

<%@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

 

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
jcjc View Drop Down
Newbie
Newbie


Joined: 12 June 2003
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcjc Quote  Post ReplyReply Direct Link To This Post 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

 

Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 12 June 2003 at 11:54am

ok, try this

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


<
%@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=>

Edited by Scotty_32
Back to Top
jcjc View Drop Down
Newbie
Newbie


Joined: 12 June 2003
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcjc Quote  Post ReplyReply Direct Link To This Post 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#

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

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

 

 

Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.