Go4Expert

Go4Expert (http://www.go4expert.com/)
-   ASP (http://www.go4expert.com/forums/asp/)
-   -   error while redirecting the page after signing into the login page (http://www.go4expert.com/forums/error-redirecting-page-signing-login-t15173/)

vinothvsp 18Nov2008 19:47

error while redirecting the page after signing into the login page
 
hi ,
i'm facing an error in my asp code, that is while login into the page it just accept the value but doesn't allow value to redirect to the concern page, plz help me to rectify the error

Code:

<%
if request.TotalBytes <> 0 then
 
dim strConnection,con,strsql,rs
strConnection="DRIVER={MySQL ODBC 5.1 Driver}; SERVER=localhost; DATABASE=chain; UID=root;PASSWORD=admin; OPTION=3"
set con=Server.CreateObject("ADODB.Connection")
con.open(strConnection)
set rs= Server.CreateObject("ADODB.RecordSet")
Dim UserName
Dim Password
UserName = request("user")
Password = request("pass")
strsql= "select * from mlm where username = '" & username &"'"
rs.open=con.Execute(strsql)
response.Write(strsql)
if rs.eof then
userstatus = 0
response.Redirect("index.asp?status=invalid")
else
if strcomp(rs.fields("password"),password,0)=0 then
session("mid") = rs.fields("username")
<--this the line no 25--> if rs.fields("username") <> 1 then
//Response.Write(UserName)
session("adminmode") = ""
else
session("adminmode") = "true"
end if
response.redirect("main.asp?id="&rs.fields("username"))
else
response.Redirect("index.asp?status=invalid")
end if
end if
if request("logout") = 1 then
session("mid") = 0
session("admin") = ""
response.redirect("")
end if
end if
%>

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: "wanted"]'
/mlm/index.asp, line 25

POST Data:
user=wanted&pass=checking&x=36&y=9


All times are GMT +5.5. The time now is 06:10.