justhrun

pulsa_isidonk.php

Aug 27th, 2014
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1. <html><head><title>Hasil: Test Pulsa</title>
  2. </head>
  3. <body>
  4. <center>
  5. <br><br>
  6. <br><br>
  7. <font size=4 color=red><b><u>hasil Submit</u></b></font><br><br>
  8. <table border=1>
  9. <tr>
  10.     <th>id produk</th>
  11.     <th>produk</th>
  12.     <th>keterangan</th>
  13. </tr>
  14. <tr>
  15. <?php
  16. if( isset($_POST['mprod']) && isset($_POST['sprod']) ) {
  17.     $ip = 'localhost';
  18.         $username = 'blabla';
  19.         $password = 'blublu';
  20.         $database = 'bleble';
  21.         $mysqlId = mysqli_connect($ip,$username,$password,$database);
  22.  
  23.         $id_prod = $_POST['mprod'];
  24.         $id_sub = $_POST['sprod'];
  25.  
  26.         $query = "select * from mproduk where id_prod='$id_prod'";
  27.         $result = mysqli_query($mysqlId,$query);
  28.     list($p_id,$nama,$ket) = mysqli_fetch_row($result);
  29.     mysqli_free_result($result);
  30.         echo "<td>$p_id</td><td>$nama</td><td>$ket</td>
  31.        </tr></table><br>
  32.        <table border=1>
  33.        <tr>
  34.    <th>id produk</th>
  35.    <th>id sub</th>
  36.    <th>sub produk</th>
  37.    <th>harga</th>
  38.        </tr>
  39.        <tr>\n";
  40.  
  41.         $query = "select * from msubproduk where id_sub='$id_sub'";
  42.         $result = mysqli_query($mysqlId,$query);
  43.     list($s_id,$p_id,$nama,$harga) = mysqli_fetch_row($result);
  44.     mysqli_free_result($result);
  45.         $price = number_format($harga,0,',','.');
  46.         echo "<td>$p_id</td><td>$s_id</td><td>$nama</td><td>$price</td>\n";
  47.  
  48. }
  49. ?>
  50. </tr></table><br>
  51. <a href=/pulsa>ulangi</a>
  52. </center>
  53. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment