Pages

Kamis, 29 April 2010

Pembuatan Form Login

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">&copy;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

tabel otomatis

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Hasil Generate Tabel</title>
</head>
<body>
<div align="center">
<?php
$rows = 1;
$columns = 1;
$cells = 1;
?>



<?php $rows = (int) $_POST["JumlahRow"]; ?>
<?php $columns = (int) $_POST["JumlahColum"]; ?>
<?php $cells = (int) $_POST["JumlahCell"]; ?>

<strong>Kamu Memilih</strong> <?php echo $rows; ?> <em>rows,</em><br />
<strong>Kamu Memilih</strong> <?php echo $columns; ?> <em>columns,</em><br />
<strong>Dan Anda Membutuhkan</strong> <?php echo $cells; ?> <em>cells,</em><br />
<br />
<br />
<?php
$width = $columns * 75;
echo "<table width=".$width." border=1>";
$rw = 0;
$cel = 1;
while ($rw < $rows && $cel <= $cells)
{
echo "<tr>";
$cl = 0;
while ($cl < $columns)
{
if ($cel <= $cells)
{
echo "<td><div align=center>".$cel."</div></td>";
$cel++;
}
$cl++;
}
echo "</tr>";
$rw++;
}
echo "</table>";
?>
</div>
</body>
</html>

Kode HTMLnya...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Generate Table by_dwipriyatmoko</title>
<style type="text/css">
<!--
#apDiv1 {
position:absolute;
width:178px;
height:24px;
z-index:1;
left: 284px;
top: 189px;
}
.style1 {
color: #0000CC;
font-weight: bold;
}
-->
</style>
</head>
<body>
<form method="post" action="tgsmod5.php">
<h3 align="center" class="style1">__Tabel Fleksibel Dengan Generate Table__</h3>
<div align="center">
<table width="327" border="0" bgcolor="#FFFFFF">
<tr bgcolor="#FFFFCC">
<td width="121" style="text-align:center">Rows</td>
<td width="196"><strong>= </strong>
<input name="JumlahRow" type="text" id="JumlahRow" onKeyUp="getmax();" onfocus="this.select();"></td>
</tr>
<tr bgcolor="#CCFFCC">
<td style="text-align:center"><label>Columns</label></td>
<td><strong>= </strong>
<input name="JumlahColum" type="text" id="JumlahColum" onKeyUp="getmax();" onfocus="this.select();"></td>
</tr>
<tr bgcolor="#FFFFCC">
<td style="text-align:center">Cell Total </td>
<td><strong>= </strong>
<input name="JumlahCell" type="text" id="JumlahCell" onKeyUp="getmax();" onFocus="this.select();"></td>
</tr>
<tr bgcolor="#CCFFCC">
<td style="text-align:center">Max Cells </td>
<td><strong>= </strong>
<input name="maxcells" type="text" id="maxcells" disabled="disabled" style="text-align:center"></td>
</tr>
</table>
</div>
<div id="apDiv1">
<input type="submit" name="Generate" value="G e n e r a t e"><input type="reset" name="Reset" value="R e s e t">
</div>
</form>
</body>
</html>

Ini Kode JavaScriptnya...
<script language="JavaScript" type="text/javascript">
<!--
function getmax() {
var R = parseInt(document.getElementById('JumlahRow').value);
var C = parseInt(document.getElementById('JumlahColum').value);
var X = parseInt(document.getElementById('JumlahCell').value);
var cellmax = document.getElementById('maxcells');
var total = 'N/A';
total = R * C;
cellmax.value = new String(total);
if (X > total)
{
alert('Cell Total Yang Anda Masukkan Terlalu Besar, Nilai Maksimum Cells = ' + total);
document.getElementById('CellsTotal').value = new String();
}
}
//-->
</script>

ini postingan mengenai membuat tabel sederhana...
silahkan copy paste untuk mencobanya... hehe
saya lagi pusing banyak tugas ini...lagi malas posting....
READ MORE - tabel otomatis
 

UM Bloggers


Universitas Negeri Malang

Sample Text

Starting Point...

Bila aku harus mengulangi hidup ini, aku akan membuat kesalahan-kesalahan yang sama, tetapi aku pastikan bahwa aku menemukan kesalahan-kesalahan itu jauh lebih awal. Sehingga keberhasilan akan datang lebih awal menjemput dan meng'elukanku.
Aku tidak tahu takdirku, tetapi aku tahu hakku untuk berhasil.