Aplikasi Login Form Sederhana (tanpa database)



Jika Berhasil Login akan keluar tampilan berikut :


Jika password dan atau user name salah maka akan keluar tampilan berikut :





Berikut adalah kode html untuk menampilkan aplikasi ogin form sederhana (tanpa database) :

<em><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Login Form</title>
<style type="text/css">
#apDiv1 {
position:absolute;
width:373px;
height:300px;
z-index:1;
left: 449px;
top: 136px;
background-color: #FFFFFF;
border: 2px solid Green;
background-image: url(1.JPG);
}
#apDiv3 {
position:absolute;
width:80px;
height:27px;
z-index:2;
left: 289px;
top: 274px;
}
.style3 {
font-size: 10px;
font-weight: bold;
}
#apDiv2 {
position:absolute;
width:412px;
height:115px;
z-index:2;
top: 0px;
left: 2px;
}
#header{
width:373px;
height:98px;
background-image: url(top1.JPG);
}
#footer{
width:373px;
height:40px;
background-image: url(footer.JPG);
}

body {
background-image: url(win.jpg);
}
</style>

</head>

<body onLoad="document.form1.user.focus();">
<script type="text/javascript">
function error1(){
alert('Masukkan User Name dan Password Terlebih Dahulu ');
}
function check()
{
if(form1.pass.value == "" || form1.user.value=="")
{
error1();
}
}
</script>
<form name="form1" method="post" action="use.php">
<div id="apDiv1">
<div id="header">
</div>
<div>
<div align="center"><strong><br>User Name :</strong>
<br>
<input type="text" name="user" size="35" value="" style="background-color:#99FFFF" autocomplete="off">
<br>
<br>
<strong>Password : </strong>
<br>
<input type="password" name="pass" size="35" style="background-color:#99FFFF" autocomplete="off">
<br>
<br>
</div>
</div>
<br>
<div id="apDiv3">
<input type="submit" name="submit" value=" ENTER " onClick="check()">
</div>
<div id="footer" align="left"><br>
</div>
</div>
</form>
</body>
</html></em>

Dan kode php-nya adalah :
<em><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Form Admin</title>
</head>
<body>
<?php
if(($_POST['user']=='romita') AND ($_POST['pass']=='teftum')) {
echo '.:Sukses:. Anda Telah Masuk Halaman Admin Dengan User Name :'.$_POST['user'];
echo '<br><br>Welcome ' . $_POST['user'];
}
else {
echo "<br><br><br><body text='red'><strong><center>Ada Kesalahan Pada Waktu Anda Login!!<br><br><a href='cobatugaslogin.html'><h4>Kembali Ke Login</h4></a></center></strong></body>";
}
?>
</body>
</html> </em>

posted under , |

0 komentar:

Posting Komentar

Posting Lebih Baru Posting Lama Beranda

Followers


Recent Comments