Jump to content

help with asp script


Recommended Posts

hi i am currently trying to show the below values from a xml script using value typed in a text box.

<user>	<username>bob</username>	<password>123</password></user>

this is my asp script and at the moment the submit button isn't sending the value from the textbox to display both the username and password. This is my code below.

<form method="POST" action="login.asp"><h1>Child nodes of root element catalog</h1><p>username: <input type="text" name= "username" id= "user" size="30" />  <input type="submit" name="submit" value="Submit"></td></p><%dim strPath, xmlFile, xmlRoot, TextValue, xmlItem, xmlNode, strText, teststrPath = Server.MapPath("staff.xml")Set xmlFile = Server.CreateObject("Microsoft.XMLDOM")xmlFile.Async = FalsexmlFile.Load(strPath)Set xmlRoot = xmlFile.DocumentElement Set xmlNode = xmlFile.DocumentElement.ChildNodesTextValue = Request.Form("username")test = Request.Form("submit")For Each xmlItem In xmlNodeif test > 1 ThenTextValue = xmlItem.TextstrText = xmlItem.TextelseResponse.write('<p>wrong</p>')End If%><P><% =strText %></p><% Next %></form>

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...