SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: New bie

  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2007
    Location
    bangalore
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    New bie

    Hai
    I am new for IT field
    I need to write code for register page in my website(project) using ASP
    Can any one tell me the logic using ASP

    thanks
    sona

  2. #2
    _ silver trophy ses5909's Avatar
    Join Date
    Jul 2003
    Location
    NoVa
    Posts
    5,466
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    You need to give us a little bit more to go on than that. Also, no one is sitting around waiting to do other people's homework, so you should really give it a try first, then if you run into problems, we can look at your code and try to help you.
    Sara

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2007
    Location
    bangalore
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    i have tried it

    my coding is as follows
    the problem is without checking anything all users names are storing in database
    [code]
    <%
    DIM objConn
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath ("db/db_name.mdb") & ";"
    objConn.Open
    %>

    <%
    DIM strusername, strpassword, stremail
    strUsername =request.form("username")
    strPassword = request.form("password")
    strEmail = request.form("email")

    IF strUsername <>"" AND strPassword<> "" AND strEmail<> "" THEN

    DIM mySQL, objRS
    mySQL = "SELECT * FROM user_list WHERE Username = ' " & strUsername & " ' "
    Set objRS = Server.CreateObject("ADODB.Recordset")
    objRS.CursorType = 1
    objRS.lockType = 3
    objRS.Open my_SQL, objConn

    IF objRS.EOF THEN
    objRS.AddNew
    objRS("Username")=strUsername
    objRS("Password")=strPassword
    objRS("Email")=strEmail
    objRS("date")=date()
    objRS.Update
    objRS.Close
    Set objRS = Nothing
    Response.Write "You have been successfully registered as: " & strUsername

    ELSE

    DIM X, strTempUsername, intCount, mySQL2, objRS2
    DO UNTIL X=True
    intCount = intCount + 1
    strTempUsername = strUsername & intCount
    strUsername = strTempUsername

    mySQL2 = "SELECT * FROM tblMembers WHERE fUsername = ' " & strUsername & " ' "
    Set objRS2 = Server.CreateObject("ADODB.Recordset")
    objRS2.Open mySQL2, objConn, adOpenKeyset, adLockPessimistic, adCmdText



    IF objRS2.EOF THEN
    X=True
    ELSE
    intCount = intCount
    END IF
    LOOP

    objRS2.Close
    Set objRS2 = Nothing

    Response.Write "That username has already been registered. Please click Back on your browser and try a different username. "
    Response.Write "We suggest you try the below available username/p>"
    Response.Write "<b> " & strUsername2 & "</b>"
    END IF

    ELSE
    Response.Write "Please click Back on your browser and complete all three fields"
    END IF
    %>
    [code]

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2007
    Location
    bangalore
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    --------------------------------------------------------------------------------

    my coding is as follows
    the problem is without checking anything all users names are storing in database
    [code]
    <&#37;
    DIM objConn
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath ("db/db_name.mdb") & ";"
    objConn.Open
    %>

    <%
    DIM strusername, strpassword, stremail
    strUsername =request.form("username")
    strPassword = request.form("password")
    strEmail = request.form("email")

    IF strUsername <>"" AND strPassword<> "" AND strEmail<> "" THEN

    DIM mySQL, objRS
    mySQL = "SELECT * FROM user_list WHERE Username = ' " & strUsername & " ' "
    Set objRS = Server.CreateObject("ADODB.Recordset")
    objRS.CursorType = 1
    objRS.lockType = 3
    objRS.Open my_SQL, objConn

    IF objRS.EOF THEN
    objRS.AddNew
    objRS("Username")=strUsername
    objRS("Password")=strPassword
    objRS("Email")=strEmail
    objRS("date")=date()
    objRS.Update
    objRS.Close
    Set objRS = Nothing
    Response.Write "You have been successfully registered as: " & strUsername

    ELSE

    DIM X, strTempUsername, intCount, mySQL2, objRS2
    DO UNTIL X=True
    intCount = intCount + 1
    strTempUsername = strUsername & intCount
    strUsername = strTempUsername

    mySQL2 = "SELECT * FROM tblMembers WHERE fUsername = ' " & strUsername & " ' "
    Set objRS2 = Server.CreateObject("ADODB.Recordset")
    objRS2.Open mySQL2, objConn, adOpenKeyset, adLockPessimistic, adCmdText



    IF objRS2.EOF THEN
    X=True
    ELSE
    intCount = intCount
    END IF
    LOOP

    objRS2.Close
    Set objRS2 = Nothing

    Response.Write "That username has already been registered. Please click Back on your browser and try a different username. "
    Response.Write "We suggest you try the below available username/p>"
    Response.Write "<b>• " & strUsername2 & "</b>"
    END IF

    ELSE
    Response.Write "Please click Back on your browser and complete all three fields"
    END IF
    %>
    [code]


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •