Ni dia kode pemrograman web untuk membuat form login...
Kode HTMLnya...
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Login Form Penjual Mimpi</title>
<link rel="stylesheet" href="wahcss.css" type="text/css" />
</head>
<body onLoad="document.form1.user.focus();">
<form name="form1" method="post" action="admin.php">
<div id="apDiv1">
<div id="header">
</div>
<div align="center">
<img src="sapi.png">
<br>
<br>
<div align="center"><strong><br>User Name :</strong>
<br>
<input type="text" name="user" size="40" value="" style="background-color:#00FF00">
<br>
<br>
<strong>Password : </strong>
<br>
<input type="password" name="pass" size="40" style="background-color:#00FF00">
<br>
<br>
<br>
<input type="submit" name="submit" value=" E N T E R " onClick="check()">
<br>
<span color="#0000FF" class="style3">©Copyright PENJUAL MIMPI</span><br>
<br>
</div>
</div>
<br>
<div align="center" id="apDiv3">
</div>
<div id="footer" align="center"><br>
</div>
</div>
</form>
</body>
</html>
Truusss....ni kode java Scriptnya...
<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>
Daaannnn, ni kode phpnya...
!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 Administrator</title>
</head>
<body>
<?php
if(($_POST['user']=='wahyu') AND ($_POST['pass']=='ganteng')) {
echo 'Berhasil, Anda Sudah Masuk Halaman Administrator Dengan User Name :'.$_POST['user'];
echo '<br><br>Hallo, saudara / saudari ' . $_POST['user'];
}
else {
echo "<br><br><br><body text='red'><strong><center>Terdapat Kesalahan Pada Waktu Anda Login...!<br><br><a href='index.html'><h4>Kembali Ke Login</h4></a></center></strong></body>";
}
?>
</body>
</html>
ini css-nya
<style type="text/css">
#apDiv1 {
position:absolute;
width:373px;
height:330px;
z-index:1;
left: 449px;
top: 136px;
background-color: #FFFFFF;
border: 2px solid Blue;
}
#apDiv3 {
position:absolute;
width:80px;
height:25px;
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();
}
#footer{
width:373px;
height:40px;
background-image: url();
}
body {
background-image: url(bws.jpg);
}
</style>
Yuuukk...dicoba....
:p
READ MORE - Pembuatan Form Login
Kode HTMLnya...
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Login Form Penjual Mimpi</title>
<link rel="stylesheet" href="wahcss.css" type="text/css" />
</head>
<body onLoad="document.form1.user.focus();">
<form name="form1" method="post" action="admin.php">
<div id="apDiv1">
<div id="header">
</div>
<div align="center">
<img src="sapi.png">
<br>
<br>
<div align="center"><strong><br>User Name :</strong>
<br>
<input type="text" name="user" size="40" value="" style="background-color:#00FF00">
<br>
<br>
<strong>Password : </strong>
<br>
<input type="password" name="pass" size="40" style="background-color:#00FF00">
<br>
<br>
<br>
<input type="submit" name="submit" value=" E N T E R " onClick="check()">
<br>
<span color="#0000FF" class="style3">©Copyright PENJUAL MIMPI</span><br>
<br>
</div>
</div>
<br>
<div align="center" id="apDiv3">
</div>
<div id="footer" align="center"><br>
</div>
</div>
</form>
</body>
</html>
Truusss....ni kode java Scriptnya...
<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>
Daaannnn, ni kode phpnya...
!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 Administrator</title>
</head>
<body>
<?php
if(($_POST['user']=='wahyu') AND ($_POST['pass']=='ganteng')) {
echo 'Berhasil, Anda Sudah Masuk Halaman Administrator Dengan User Name :'.$_POST['user'];
echo '<br><br>Hallo, saudara / saudari ' . $_POST['user'];
}
else {
echo "<br><br><br><body text='red'><strong><center>Terdapat Kesalahan Pada Waktu Anda Login...!<br><br><a href='index.html'><h4>Kembali Ke Login</h4></a></center></strong></body>";
}
?>
</body>
</html>
ini css-nya
<style type="text/css">
#apDiv1 {
position:absolute;
width:373px;
height:330px;
z-index:1;
left: 449px;
top: 136px;
background-color: #FFFFFF;
border: 2px solid Blue;
}
#apDiv3 {
position:absolute;
width:80px;
height:25px;
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();
}
#footer{
width:373px;
height:40px;
background-image: url();
}
body {
background-image: url(bws.jpg);
}
</style>
Yuuukk...dicoba....
:p