error while redirecting the page after signing into the login page

Discussion in 'ASP' started by vinothvsp, Nov 18, 2008.

  1. vinothvsp

    vinothvsp New Member

    Joined:
    Nov 16, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    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
     
    Last edited by a moderator: Nov 18, 2008

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice