Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Redirect Hell

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,53126
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Redirect Hell
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Redirect Hell - 10/29/2007 8:17:13 PM   
  farney

 

Posts: 1
Score: 0
Joined: 10/29/2007
Status: offline
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
 
 
Post #: 1
 
 RE: Redirect Hell - 10/30/2007 1:47:49 AM   
  webber123456

 

Posts: 37
Score: 0
Joined: 9/20/2007
Status: offline
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

(in reply to farney)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Redirect Hell Page: [1]
Jump to:





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
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts