HOw to make a simple login form using HTML.
- linuxtech
- Jul 15, 2020
- 1 min read
source code:<html>
<head>
<title>Login Page</title>
</head>
<body>
<form name="loginForm" method="post" action="login.php">
<table width="50%" bgcolor="red" align="center">
<tr>
<td colspan=4><center><font size=10><b>HTML Login Page made by linux tech</b></font></center></td>
</tr>
<tr>
<td>Username:</td>
<td><input type="text" size=50 name="userid"></td>
</tr>
<tr>
<td>student id number:</td>
<td><input type="id " size=25 name="pwd"></td>
</tr>
<tr>
<td ><input type="Reset"></td>
<td><input type="submit" onclick="return check(this.form)" value="Login"></td>
</tr>
</table>
</form>
<script language="javascript">
function check(form)
{
if(form.userid.value == "linux tech" && form.pwd.value == "35313")
{
return true;
}
else
{
alert("Error Password or Username")
return false;
}
}
</script>
</body>
</html>


Comments