title: How to match credentails using XML on login HTML page?
body: <p>Locally I am trying to match the login credentails using the XML page which will act like database. If the login credentails matches, it must proceed to next page which will be new HTML page containing something. Here's what I have till now in HTML &amp; XML page. I did the validation using the JavaScript and hard coded for one user. In XML if I have say 10 users then how do I do? </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;title&gt;Login page&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;
  
  &lt;div align="right"&gt;
  &lt;h1 style="font-family:Times New Roman;text-align="center";font-size:20pt;
  color:#00FF00;&gt;
  Welcome to Login Page
  &lt;/h1&gt;
  &lt;form name="login"&gt;
  Username: &amp;nbsp &lt;input type="text" name="userid"/&gt;&lt;br&gt;&lt;br&gt;
  Password:  &amp;nbsp  &lt;input type="password" name="paasword"/&gt;&lt;br&gt;&lt;br&gt;
  &lt;input type="button" onclick="check(this.form)" value="Login"/&gt;
  &lt;input type="reset" value="Cancel"/&gt;
  &lt;/form&gt;
  &lt;script language="javascript"&gt;
  function check(form)/*function to check userid &amp; password*/
  {
  /*the following code checkes whether the entered userid and password are matching*/
  if(form.userid.value == "user1" &amp;&amp; form.password.value == "pass1")
  {
  window.open('success.html')/*opens the target page while Id &amp; password matches*/
  }
  else
  {
  alert("wrong Username or Password")/*displays error message*/
  }
  }
  &lt;/script&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>XML code: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
  &lt;student&gt;
  
  &lt;details&gt;
  &lt;username&gt;user1&lt;/username&gt;
  &lt;password&gt;pass1&lt;/password&gt;
  &lt;email&gt;user1@abc.com&lt;/email&gt;
  &lt;/details&gt;
  
  &lt;details&gt;
  &lt;username&gt;user2&lt;/username&gt;
  &lt;password&gt;pass2&lt;/password&gt;
  &lt;email&gt;user2@abc.com&lt;/email&gt;
  &lt;/details&gt;
  
  &lt;details&gt;
  &lt;username&gt;user3&lt;/username&gt;
  &lt;password&gt;pass3&lt;/password&gt;
  &lt;email&gt;user3@abc.com&lt;/email&gt;
  &lt;/details&gt;
  
  &lt;details&gt;
  &lt;username&gt;user4&lt;/username&gt;
  &lt;password&gt;pass4&lt;/password&gt;
  &lt;email&gt;user4@abc.com&lt;/email&gt;
  &lt;/details&gt;
  
  &lt;/student&gt;
  </code></pre>