mardi 29 mars 2016

How do i add a page where a user can create an account, then login using the login code below?

This is the code i want to use for logging in.

<!DOCTYPE html>
<html>
<head>
<title>Login page</title>
</head>
<body>
<h1>Simple Login Page</h1>
<form name="login">
Username<input type="text" name="userid"/>
Password<input type="password" name="pswrd"/>
<input type="button" onclick="check(this.form)" value="Login"/>
input type="reset" value="Cancel"/>
</form>
<script language="javascript">
function check(form) { /*function to check userid & password*/
/*the following code checkes whether the entered userid and password are       matching*/
if(form.userid.value == "Jarrett" && form.pswrd.value == "813401") {
window.open('target.html')/*opens the target page while Id & password  matches*/
else {
alert("Error Password or Username")/*displays error message*/
}
}
</script>
</body>
</html>

How do i made a page where useres can create their username and password, then login on a diffrent page that is using this code above?




Aucun commentaire:

Enregistrer un commentaire