Rabu, 26 Oktober 2011

script php dalam pembuatan buku tamu

<html>
<head>
<title>Buku Tamu</title>
</head>

<body>
<form name="form1"method="post"action="praktikum3_1.php">
<table width="418" border="0" align="center">
  <tr>
    <td colspan="2"><div align="left">Buku tamu</div></td>
  </tr>
  <tr>
    <td>Nama</td>
    <td><input type="text" name="txtnama"/></td>
  </tr>
  <tr>
    <td>Email</td>
    <td><input type="text" name="txtemail"/></td>
  </tr>
 <tr>
    <td>Web</td>
    <td><input type="text" name="txtweb"/></td>
  </tr>
    <tr>
    <td>Komentar</td>
    <td><input type="text" name="txtKomentar"/></td>
  </tr>
   <tr>
    <td>&nbsp;</td>
    <td><input type="submit" value="Kirim" name="submit"/><input type="reset" value="Reset"/></td>
  </tr>
</table>
</form>

<?php
function tampil_komentar()
{
if($_POST['submit']=="Kirim")   
{
echo("<p align=left><strong>Komentar anda</strong></p>");
echo("Nama Anda :$_POST[txtnama]");
echo("<br>Email Anda:$_POST[txtemail]");
echo("<br>web anda:<a href='https://$_POST[txtweb]'>$_POST[txtweb]</a>");
echo("<br>Komentar:$_POST[txtKomentar]");
echo("<br><hr>");
}
}
tampil_komentar();
?>
</body>
</html>

Tidak ada komentar:

Posting Komentar