Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $server = "localhost";
- $username = "root";
- $password = "";
- $database = "dbspg";
- // Koneksi dan memilih database di server
- mysql_connect($server,$username,$password) or die("Koneksi gagal");
- mysql_select_db($database) or die("Database tidak bisa dibuka");
- ?>
- <html>
- <head>
- <title></title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <link href="styles.css" rel="stylesheet" type="text/css">
- <!--
- body {
- background-image: url(image/background.jpg);
- background-repeat:no-repeat;
- background-position:top;
- font-family:"Courier New", Courier, monospace;
- font-weight:bold;
- }
- .style1 {font-weight: bold}
- .style2 {color: #009933}
- .style5 {color: #000000}
- -->
- </style>
- <script type="text/javascript">
- function cetak()
- {
- window.print();
- window.close();
- }
- </script>
- </head>
- <body>
- <body onLoad="window.print()">
- <?php
- $id = $_GET['nama'];
- $sql = "select * from hubungi where id='$id'";
- $result = mysql_query($sql);
- $row = mysql_fetch_array($result);
- mysql_query($sql) or die( mysql_error() );
- ?>
- </tr>
- <tr>
- <table width="630" border="0" align="center" cellpadding="3" cellspacing="3" class="forms">
- <tr>
- <td>
- <td align="center">
- <div align="left"><b>Penampakan Data</b></div>
- <td align="center">
- <tr>
- <td bgcolor="">Nama<br> </td>
- <td bgcolor="">
- : <?php echo $row['nama'];?></td>
- </tr>
- <tr>
- <td bgcolor="">Alamat<br> </td>
- <td bgcolor="">
- : <?php echo $row['alamat'];?></td>
- </tr>
- <tr>
- <td bgcolor="">subjek<br></td>
- <td bgcolor="">: <?php echo $row['subjek'];?></td>
- </tr>
- <tr>
- <td bgcolor="">pesan<br></td>
- <td bgcolor="">: <?php echo $row['pesan'];?></td>
- </tr>
- </table>
- </div>
- </div>
- </div>
- </td>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement