Redirect Hell

Author Message
farney

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 10/29/2007
  • Status: offline
Redirect Hell Monday, October 29, 2007 9:17 PM (permalink)
0
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
 
#1
    webber123456

    • Total Posts : 58
    • Scores: 0
    • Reward points : 0
    • Joined: 9/20/2007
    • Status: offline
    RE: Redirect Hell Tuesday, October 30, 2007 2:47 AM (permalink)
    0
    The Buffer property cannot be set after the server has sent output to the client. For this reason, the call to Response.Buffer should be the first line of the .asp file.

    http://msdn2.microsoft.com/en-us/library/ms526001.aspx
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9