Hey Guys and Girls.
Am very very new to VBScript so please bare with me.
I am trying to create a login script for my site.
I am connecting to a Database checking the details (which seems to work fine) however what it then needs to do is redirect that specific user to the page i have entered on his record (hope that makes sense) using response.redirect but it just won't work and i have no idea why. Can anyone help? My code is below:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Please Wait</title>
</head>
<body>
<%@LANGUAGE = VBScript%>
<%
Dim username,password
username = Request.Form("username")
password = Request.Form("password")
If username = "" OR password = "" Then
Response.Redirect("index.asp")
Else
Dim cn,returndata
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open "Driver={SQL Server};Server=ATLAS-SQL-02;Database=acornncouk_89781_db1;User Id=uacornn_89781_1;Password=4Bs?/c0D"
Set returndata = cn.Execute("SELECT webaddress FROM tblUser WHERE username LIKE '" & username & "' AND password LIKE '" & password & "'")
dim waddress=waddress = cn(webaddress)
If returndata.EOF Then
Response.Redirect("index.asp")
Else
Response.buffer=true
Response.clear
Response.Redirect("waddress")
End if
End if
%>
</body>
</html>
Thanks in advance