/    Sign up×
Community /Pin to ProfileBookmark

xml login check

I need a code to check 2 things when a user signs up

  • 1. username

  • 2. email
  • if its taken already it will reply taken please pick another.

    I am using xml and asp

    to post a comment

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @bogoclesJul 08.2008 — This is trickier than simply making an XML login page.

    You'll need another step. Remember, XML does not DO anything by itself. That other step will be transforming it into an XHTML page with a login form element on it.

    Alternatively, you could write an ASP script that dynamically traverses the login XML (using the DOM parser) and creates new HTML elements and checks them for validity. This is probably a bit more difficult.

    These sound like adding unnecessary steps, I know, so you'll need to rethink whether or not you really want to do this with XML. Unless you absolutely do, just do this with HTML instead.

    You can also check out XForms it you'd like. Be aware, though, that support for them is generally lacking.
    Copy linkTweet thisAlerts:
    @kbdavis07authorJul 09.2008 — I am sorry I did not provide the code I have so far and not being specfic on what I am looking for.

    [COLOR="Yellow"]

    I am using ASP 3.0 "Classic ASP" with VBScript and XML with MSxml 3.0 parser on my server that I am using.

    [/COLOR]


    I have 3 files.

  • 1. Join.html <- User Picks a username and password and enter email address


  • 2. ProcessUserSignUpForm.asp <-- Processes the Join.html page.


  • 3. checkXML.xml <-- List of users names, ProcessUserSignUpForm.asp checks this xml file to see if the user already exists. If not then it will add the user info. but its not in the code yet.


  • [COLOR="DarkGreen"]

    All I am looking for is the code the parser uses to search and compare the complete checkXML.xml file. I do not want the same Username or email address.[/COLOR]



    Hope this helps explain what I am looking for.

    Thanks,

    Brian Davis
    ----------------------------------------------------------------



    Join.html


    <html>

    <head>

    <title>

    Join

    </title>

    </head>

    <body>

    <form action="ProcessUserSignUpForm.asp" method="post">


    <h3>Pick a Username and Password.</h3>


    UserName: <input type="text" name="FormUserName"><br>

    Password: <input type="text" name="FormPassWord"><br>

    E-Mail: <input type="text" name="FormEmail"><br>

    <input type="submit" id="btnSub" name="btnSub" value="Submit"><br>

    </form>

    </body>

    </html>



    ------------------------------------------------------------------------


    ProcessUserSignUpForm.asp


    <%@ LANGUAGE=VBSCRIPT %>

    <% Option Explicit %>

    <% Response.Buffer = False %>

    <%

    Dim users,role,admin,user,usr,pwd,email,UserName

    usr = Request.Form("FormUserName")

    pwd = Request.Form("FormPassword")

    email = Request.Form("FormEmail")





    'On Error Resume Next
    Dim xmldoc, nodeList, node
    Set xmldoc = Server.CreateObject("Microsoft.XMLDOM")
    xmldoc.async = False

    xmldoc.load(Server.MapPath("checkXML.xml"))


    If xmldoc.parseError.ErrorCode=0 Then

    Set nodeList = xmldoc.documentElement.getElementsByTagName("UserName")

    ^

    |

    [COLOR="Lime"] [<--Need to search the entire xml file this is the code that I need][/COLOR]



    If nodeList.length>0 Then

    If nodeList.Item(0).Text = usr Then


    response.write ("User Name taken")

    On Error Resume Next
    Session("UserRole") = nodeList.Item(0).attributes.getNamedItem("role").nodeValue
    If Err.Number<>0 Then
    Session("UserRole") = "GUEST"
    End If
    End If
    End If
    End If




    UserName = xmlDoc.getElementsByTagName("UserName").item(0).text












    Set xmldoc = Nothing


    response.write ("<hr>")

    response.write ("<br>")



    response.write ("XML NodeList.Item(0).Text : ")

    response.write nodeList.Item(0).Text

    response.write ("<br>")


    response.write ("Form UserName: ")

    response.write (usr)

    response.write ("<br>")


    response.write ("Stored UserName: ")

    response.write (UserName)

    response.write ("<br>")


    response.write ("PassWord:")

    response.write (pwd)

    response.write ("<br>")


    response.write ("Email:")

    response.write (email)

    response.write ("<br>")




    response.write ("<hr>")

    If usr = UserName Then

    response.write ("User Name is taken")

    End if




    %>


    ------------------------------------------------------------------------

    checkXML.xml



    <?xml version="1.0" encoding="ISO-8859-1"?>

    <members>


    <member>

    <UserName> Kbdavis07 </UserName>
    <Email> [email][email protected][/email]</Email>
    <PassWord> 123 </PassWord>


    </member>




    <member>

    <UserName> user123 </UserName>
    <Email> [email][email protected][/email] </Email>
    <PassWord> bdavis28 </PassWord>


    </member>






    <member>

    <UserName> user124 </UserName>
    <Email> [email][email protected][/email] </Email>
    <PassWord> bdavis28 </PassWord>


    </member>













    </members>


    ---------------------------------------------------------------------
    ×

    Success!

    Help @kbdavis07 spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 4.29,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...