﻿<!DOCTYPE html>
<html>
	<head>
		<title>User Input</title>
		<style>
			.embolden
			{
				font-weight:bold;
				font-family:Verdana, Geneva, Tahoma, sans-serif;
				font-size:16px;
			}
		</style>
	</head>

	<body>
		<table>
			<tr>
				<td>
					<span>Username:</span>
				</td>
				<td>
					<span id="passedInUsername" style="width:100%;" 
							class="embolden"></span>
				</td>
			</tr>
			<tr>
				<td>
					<span>Password:</span>
				</td>
				<td>
					<span id="passedInPassword" style="width:100%;" 
							class="embolden"></span>
				</td>
			</tr>
			<tr>
				<td>
					<span>Secret Question:</span>
				</td>
				<td>
					<span id="passedInQuestion" style="width:100%;" 
							class="embolden"></span>
				</td>
			</tr>

		</table>
		
		<script type="text/javascript">
		    //modified from: 
		    //http://stackoverflow.com/questions/7269640/html-passing-value-using-query-string
			function getQSVariableValue(variable) { 
			  var query = window.location.search.substring(1); 
			  var vars = query.split("&"); 
			  for (var i=0;i<vars.length;i++) { 
			    var pair = vars[i].split("="); 
			    if (pair[0] == variable) { 
			      return pair[1]; 
			    }
			  } 
			} 
			
			//modified from:
			//http://stackoverflow.com/questions/4784568/set-content-of-html-span-with-javascript
			function removeSpanChildren(spanobj){
				while(spanobj.firstChild){
					spanobj.removeChild(spanobj.firstChild);
				}
			}
			
			function appendSpanText(spanobj, value){
				spanobj.appendChild(document.createTextNode(value));
			}
			
			
			//username
			var un = document.getElementById("passedInUsername");
			removeSpanChildren(un);
			appendSpanText(un, getQSVariableValue("userName"));
			
			//password
			var pwd = document.getElementById("passedInPassword");
			removeSpanChildren(pwd);
			appendSpanText(pwd, getQSVariableValue("password"));
						
			
			//secretQuestion
			var cm = document.getElementById("passedInQuestion");
			removeSpanChildren(cm);
			appendSpanText(cm, getQSVariableValue("secretQuestion"));

			
		</script>
	</body>
</html>
Add Result.html to display user inputs
Add Result.html to display user inputs
