đặt code sau vào HTML xong chọn ở Use this page as homepage ?:có ...........Bạn thay đổi những cái mà yêu cầu thay
- Code:
-
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="author" content="TEAM ViRiLiTY">
<title>Dang nhap bang Javascript</title>
<script type="text/javascript">
function login()
{
//day la lenh dung de lay du lieu tu 2 form nhap user va password
//gan 2 gia tri do cho 2 bien user,password
user=document.dulieu.ten.value;
password=document.dulieu.matkhau.value;
//kiem tra neu dung thi cho chay trang web can vao
if(user=="ID bạn muốn" && password=="pass bạn muốn")
{
//day la ham chuyen den trang web can xem
window.location="đổi thành đường dẫn vào web bạn";
}
else
{
//neu ko dung thi bao ko thanh cong
alert("That Bai");
}
return false;
}
</script>
</head>
<body>
<form onsubmit="return login();" method="POST" enctype="text/plain" name="dulieu">
<p>
<label>User :</label><input type="text" name="ten" /></p>
<p>
<label>Password :</label><input type="password" name="matkhau" /></p>
<input type="submit" value="Login" name="Login" />
</form>
<a href="http://[url=http://www.forumvi.com%22]www.forumvi.com"[/url] target="_blank">forumvi.com</a>
</body>
</html>