Web Analytics Made Easy -
StatCounter sign in - CodingForum

Announcement

Collapse
No announcement yet.

sign in

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • sign in

    how can i know if a user name and password enterd by members in my site is valid and exist in my database

  • #2
    Try reading this through. There is an example at the bottom of the page:

    http://www.asp101.com/samples/login.asp

    HTH
    As easy as 3.1415926535897932384626433832795028841

    Comment


    • #3
      I also have a sample registration/login script in ASP with Access 2000 database on my website for free.
      Former ASP Forum Moderator - I'm back!

      If you can teach yourself how to learn, you can learn anything. ;)

      Comment


      • #4
        thank you this file will be very usefull for me,but i as abeginner in asp i wrote a simple script to do the same function but it dosen't work why ??

        <%
        inname=request.form ("username")
        inpsd=requset.form("password")
        %>

        <% set com=server.CreateObject ("adodb.connection")
        com.Open ("toto")
        sql="select (uname,password) from table1"
        set rs=com.Execute (sql)
        while not rs.eof%>

        <%
        if rs(2)=="inname" then
        if rs(3)=="inpsd" then
        Response.Write (inname)
        Response.Write (inpsd)
        flag=1
        rs.movenext
        wend%>
        <% msg="wrong username or password"
        if flag!=1 then%>
        <%=msg%>

        Comment


        • #5
          Try this instead:

          sql="SELECT uname,password FROM table1 WHERE uname = '" & uname & "' AND password = '" & password & "' "

          set rs=com.Execute (sql)

          IF NOT rs.EOF THEN
          'username and password both match
          ELSE
          'redirect them somewhere or make them login again
          END IF

          Former ASP Forum Moderator - I'm back!

          If you can teach yourself how to learn, you can learn anything. ;)

          Comment

          Working...
          X