Pages

Jumat, 17 Januari 2014

Menampilkan Komentar

Form

<html>

<head>

<title>Kontak</title>

</head>

<body background="Gambar/star.gif">

  <table width="1000" height="712" bgcolor="#0066FF" border="0" cellspacing="2" cellpadding="0" align="center">

   <tr>

    <td colspan="7"><img src="Gambar/Beground web2.jpg" width="1000" height="200" alt="Beground web" longdesc="Gambar/Beground web.jpg" /></td>

  </tr>

    <td width="146" height="26" align="center" bgcolor="#0000CC" ><a href="index.html"style="text-decoration:none"><font face="high tower text" color="#FFFFFF">Beranda</font></a></td>

    <td width="146" align="center" bgcolor="#0000FF" ><a href="Profil.html" style="text-decoration:none"><font face="high tower text" color="#FFFFFF">Profil</font></a></td>

    <td width="146" align="center" bgcolor="#0000CC" ><a href="Catatan.html" style="text-decoration:none"><font face="high tower text" color="#FFFFFF">Catatan</font></a></td>

    <td width="146" align="center" bgcolor="#0000FF" ><a href="Galeri.html" style="text-decoration:none"><font face="high tower text" color="#FFFFFF">Galeri</font></a></td>

    <td width="146" align="center" bgcolor="#0000CC" ><a href="Kontak.html" style="text-decoration:none"><font color="#CC0066">Kontak</font></a></td>

     <td width="125" rowspan="18" valign="top" align="center" bgcolor="#FFFFFF" ><img src="Gambar/Logoku.gif" width="125" height="119" alt="Logoku" longdesc="Gambar/Logoku.gif"></td>

  </tr>

  <tr><td colspan="5" align="left">

  <font face="magneto" size="+2" color="#FFFFFF">Form Komentar</font></td>

  </tr>

  <tr>

    <td colspan="5" align="left">

<form method="post" action="proses2.php">

<tr>

 <td><font face="high tower text" color="#FFFFFF">Nama</font></td>

   <td><input type="text" name="Nama"></td></tr>

<tr>

 <td><font face="high tower text" color="#FFFFFF">Email</font></td>

   <td><input type="text" name="Email"></td>

    </tr>

<tr>

 <td><font face="high tower text" color="#FFFFFF">Komentar</font></td>

    <td><textarea name="Komentar"></textarea></td>

</tr>

<tr>

 <td colspan="5" align="left"><input type="reset" value="Reset"> <input type="submit" value="Post"></td></tr>

</form>

    </td>

    </tr>

</table>

</body>

</html>

Proses

<?PHP

$connect = mysql_connect("localhost","root","")

or die(mysql_error());

mysql_select_db("perusahaan", $connect);

$Nama = $_POST['Nama'];

$Email = $_POST['Email'];

$Komentar = $_POST['Komentar'];

$q = "INSERT INTO koment (

Nama,

Email,

Komentar

)

VALUES(

'$Nama',

'$Email',

'$Komentar'

)";

if(mysql_query($q,$connect)){

echo "Data berhasil dimasukkakan”;

}

else{

die(mysql_error());

}

?>

Tampilan

<?PHP

include_once("connect.php");

echo"

       <html><head>

<title>Form Komentar</title></head>

<body background=\"Gambar/star.gif\">

  <table width=\"1000\" height=\"500\" bgcolor=\"#0066FF\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\" align=\"center\">

   <tr>

    <td colspan=\"7\"><img src=\"Gambar/Beground web2.jpg\" width=\"1000\" height=\"200\" alt=\"Beground web\" longdesc=\"Gambar/Beground web.jpg\" /></td>

  </tr>

  <tr>

  <td width=\"136\" rowspan=\"8\" align=\"center\" bgcolor=\"#FFFFFF\" valign=\"top\"><a href=\"https://www.facebook.com\"><img src=\"Gambar/facebook.png\" width=\"60\" height=\"60\" alt=\"facebook\" longdesc=\"Gambar/facebook.png\"></a><a href=\"https://www.twitter.com\"><img src=\"Gambar/twitter.png\" width=\"60\" height=\"60\" alt=\"twitter\" longdesc=\"Gambar/twitter.png\"></a><a href=\"https://www.blogspot.com\"><img src=\"Gambar/blogspot.png\" width=\"60\" height=\"60\" alt=\"blogspot\" longdesc=\"Gambar/blogspot.png\"></a><a href=\"https://www.gmail.com\"><img src=\"Gambar/gmail.png\" width=\"60\"height=\"60\" alt=\"gmail\" longdesc=\"Gambar/gmail.png\"></a></td>



    <td width=\"146\" height=\"26\" align=\"center\" bgcolor=\"#0000CC\" ><a href=\"index.html\"style=\"text-decoration:none\"><font face=\"high tower text\" color=\"#FFFFFF\">Beranda</font></a></td>

    <td width=\"146\" align=\"center\" bgcolor=\"#0000FF\" ><a href=\"Profil.html\" style=\"text-decoration:none\"><font face=\"high tower text\" color=\"#FFFFFF\">Profil</font></a></td>

    <td width=\"146\" align=\"center\" bgcolor=\"#0000CC\" ><a href=\"Catatan.html\" style=\"text-decoration:none\"><font face=\"high tower text\" color=\"#FFFFFF\">Catatan</font></a></td>

    <td width=\"146\" align=\"center\" bgcolor=\"#0000FF\" ><a href=\"Galeri.html\" style=\"text-decoration:none\"><font face=\"high tower text\" color=\"#FFFFFF\">Galeri</font></a></td>

    <td width=\"146\" align=\"center\" bgcolor=\"#0000CC\" ><a href=\"Kontak.html\" style=\"text-decoration:none\"><font color=\"#CC0066\">Kontak</font></a></td>

  

     <td width=\"125\" rowspan=\"8\" valign=\"top\" align=\"center\" bgcolor=\"#FFFFFF\" ><img src=\"Gambar/Logoku.gif\" width=\"125\" height=\"119\" alt=\"Logoku\" longdesc=\"Gambar/Logoku.gif\"></td>

  </tr>

  <tr>

    <td colspan=\"5\"><font face=\"snap itc\" size=\"+2\" color=\"#FFFFFF\"><marquee direction=\"left\">.....Selamat Datang..... </marquee></font></td>

    </tr>

       <tr>

    <td height=\"48\" colspan=\"5\"><center><h1>Daftar Komentar</h1></center>

       <tr>

        <th height=\"20\">Nomor</th>

        <th height=\"20\">Nama</th>

        <th height=\"20\" colspan=\"2\">Email</th>

        <th height=\"20\">Komentar</th>

  </tr>

       </td>

  </tr>";

     

$data = mysql_query("SELECT * FROM koment");

while($row = mysql_fetch_array($data))

{

       echo" <tr>

                                       <td>$row[Nomor]</td>

                                       <td>$row[Nama]</td>

                                       <td colspan=\"2\">$row[Email]</td>

                                       <td>$row[Komentar]</td>

                                     

                         </tr>";

}

echo"

<td colspan=\"5\" align=\"center\"><a href=\"edite.php\">Edit Komentar</a></td>

<tr>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

  </tr><tr>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

  </tr>

    <tr>

    <td colspan=\"7\"><font face=\"snap itc\" size=\"+2\" color=\"#FFFFFF\"><marquee direction=\"right\"> ...Terima Kasih Atas Kunjungannya...</marquee></font>

    <p align=\"right\"><font face=\"high tower text\" color=\"#FFFFFF\">Graficha AK</font></p></td>

  </tr>

</table>

</body>

</html>

";

?>

Edit

<?PHP

 include_once("tampilan.php");

 echo "<html><body><center><form method = \"POST\" action = \"editproses.php\">

 <table><tr>

       <td>Edit data Nama ...</td>

       <td><input type = \"text\" name = \"Nama\"></td>

       </tr>

       <tr>

       <td>Email</td>

       <td><input type = \"text\" name = \"Email\"></td>

       </tr>

       <tr>

        <td>Komentar</td>

        <td><input type = \"text\" name = \"Komentar\"></td>

       </tr>

 </table>

 <input type = \"submit\" name = \"Update\" value = \"Update\">

 <input type = \"submit\" name = \"Delete\" value = \"Delete\">

  <input type = \"reset\" name = \"Reset\">

 </form></center></body></html>";

?>

0 comments:

Posting Komentar