ini untuk buku tamunya :
simpan dengan nama :
tamu.php
dan ini untuk penyimpanan buku tamunya :
proses.php
ini untuk tampilannya :
tampil.php
contohnya : http://gohack.web.id/staff/index.php
untuk script t4 upload dsni :
http://hacker-newbie.org/showthread.php?tid=6497
and jangan lupa :
http://hacker-newbie.org/reputation.php?uid=198
./Up
simpan dengan nama :
tamu.php
PHP Code:
<html>
<head>
<title>Buku Tamu</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="650" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="650" height="440" valign="top"><form action="proses.php" method="post" name="form1" target="_top">
<table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
<td width="14%"><div align="right">Nama:</div></td>
<td><input name="nm" type="text" id="nm" size="30" maxlength="30"></td>
</tr>
<tr>
<td><div align="right">E-mail:</div></td>
<td><input name="em" type="text" id="em" size="30" maxlength="30"></td>
</tr>
<tr>
<td><div align="right">Alamat:</div></td>
<td><input name="al" type="text" id="al" size="45" maxlength="45"></td>
</tr>
<tr>
<td height="105"> <div align="right">Pesan:</div></td>
<td><textarea name="ps" cols="35" rows="5" id="ps"></textarea></td>
</tr>
<tr>
<td> </td>
<td> <input type="submit" name="Submit" value="Proses"></td>
</tr>
</table>
<a href="tampil.php">Lihat Data Buku Tamu </a>
</form></td>
</tr>
</table>
</body>
</html>
dan ini untuk penyimpanan buku tamunya :
proses.php
PHP Code:
<?php
//menentukan nama table
$db_name = "deco_db"; <-- nama database anda
$table_name= "tamu"; <-- nama table
//koneksikan ke server dan memilih data base
$connection =@mysql_connect("localhost","","") or die(mysql_error());
$db = @mysql_select_db($db_name, $connection) or die(mysql_error());
//membangun query
$sql = "insert into
$table_name (nama,email,alamat,pesan)
values('$nm','$em','$al','$ps')";
$result =@mysql_query($sql,$connection) or die(mysql_error());
if ($result)
{ echo " Data Anda Terkirim <br>"; }
else
{ echo " Maaf, Data Anda Gagal Terkirim <br>"; }
include ("tamu.php");
?>ini untuk tampilannya :
tampil.php
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="650" height="440" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="650" height="62" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="650" height="62"><div align="center">Daftar Buku Tamu</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="378" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="650" height="111" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="650" height="111">
<?php
$host=localhost;
$user="";
$pass="";
$link = mysql_connect ("$host", "$user", "$pass")
or die ("Koneksi Server Gagal");
mysql_select_db("deco_db");
$perintah = "SELECT * from tamu ";
$minta = mysql_query($perintah);
while($hs=mysql_fetch_array($minta))
{ echo " No. Urut $hs[id]<br> ";
echo " Nama : $hs[nama] <br>";
echo " E-mail: $hs[email] <br>";
echo " Alamat: $hs[alamat] <br>";
echo " Pesan: $hs[pesan] <br>";
echo " <hr> "; }
print (" <a href=tamu.php target=_self>Kembali</a> ");
?>;</td>
</tr>
</table></td>
</tr>
<tr>
<td height="267"> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
contohnya : http://gohack.web.id/staff/index.php
untuk script t4 upload dsni :
http://hacker-newbie.org/showthread.php?tid=6497
and jangan lupa :
http://hacker-newbie.org/reputation.php?uid=198
./Up
PHP Code:
root@xh4x0r / $ ~



