Advertisement
bincar

file print.php(print out put form)

Feb 23rd, 2014
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. <?php
  2.  
  3. $server = "localhost";
  4. $username = "root";
  5. $password = "";
  6. $database = "dbspg";
  7.  
  8. // Koneksi dan memilih database di server
  9. mysql_connect($server,$username,$password) or die("Koneksi gagal");
  10. mysql_select_db($database) or die("Database tidak bisa dibuka");
  11.  
  12. ?>
  13. <html>
  14. <head>
  15. <title></title>
  16. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  17. <link href="styles.css" rel="stylesheet" type="text/css">
  18. <!--
  19. body {
  20. background-image: url(image/background.jpg);
  21. background-repeat:no-repeat;
  22. background-position:top;
  23. font-family:"Courier New", Courier, monospace;
  24. font-weight:bold;
  25. }
  26. .style1 {font-weight: bold}
  27. .style2 {color: #009933}
  28. .style5 {color: #000000}
  29. -->
  30. </style>
  31. <script type="text/javascript">
  32. function cetak()
  33. {
  34. window.print();
  35. window.close();
  36. }
  37. </script>
  38. </head>
  39. <body>
  40. <body onLoad="window.print()">
  41. <?php
  42. $id = $_GET['nama'];
  43. $sql = "select * from hubungi where id='$id'";
  44. $result = mysql_query($sql);
  45. $row = mysql_fetch_array($result);
  46. mysql_query($sql) or die( mysql_error() );
  47.  
  48. ?>
  49. </tr>
  50. <tr>
  51. <table width="630" border="0" align="center" cellpadding="3" cellspacing="3" class="forms">
  52. <tr>
  53. <td>
  54.  
  55.  
  56. <td align="center">
  57. <div align="left"><b>Penampakan Data</b></div>
  58. <td align="center">
  59. <tr>
  60. <td bgcolor="">Nama<br> </td>
  61. <td bgcolor="">
  62. : <?php echo $row['nama'];?></td>
  63.  
  64. </tr>
  65. <tr>
  66. <td bgcolor="">Alamat<br> </td>
  67. <td bgcolor="">
  68. : <?php echo $row['alamat'];?></td>
  69. </tr>
  70. <tr>
  71. <td bgcolor="">subjek<br></td>
  72. <td bgcolor="">: <?php echo $row['subjek'];?></td>
  73. </tr>
  74.  
  75.  
  76. <tr>
  77. <td bgcolor="">pesan<br></td>
  78. <td bgcolor="">: <?php echo $row['pesan'];?></td>
  79. </tr>
  80. </table>
  81. </div>
  82. </div>
  83. </div>
  84. </td>
  85. </body>
  86. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement