Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html><head><title>Hasil: Test Pulsa</title>
- </head>
- <body>
- <center>
- <br><br>
- <br><br>
- <font size=4 color=red><b><u>hasil Submit</u></b></font><br><br>
- <table border=1>
- <tr>
- <th>id produk</th>
- <th>produk</th>
- <th>keterangan</th>
- </tr>
- <tr>
- <?php
- if( isset($_POST['mprod']) && isset($_POST['sprod']) ) {
- $ip = 'localhost';
- $username = 'blabla';
- $password = 'blublu';
- $database = 'bleble';
- $mysqlId = mysqli_connect($ip,$username,$password,$database);
- $id_prod = $_POST['mprod'];
- $id_sub = $_POST['sprod'];
- $query = "select * from mproduk where id_prod='$id_prod'";
- $result = mysqli_query($mysqlId,$query);
- list($p_id,$nama,$ket) = mysqli_fetch_row($result);
- mysqli_free_result($result);
- echo "<td>$p_id</td><td>$nama</td><td>$ket</td>
- </tr></table><br>
- <table border=1>
- <tr>
- <th>id produk</th>
- <th>id sub</th>
- <th>sub produk</th>
- <th>harga</th>
- </tr>
- <tr>\n";
- $query = "select * from msubproduk where id_sub='$id_sub'";
- $result = mysqli_query($mysqlId,$query);
- list($s_id,$p_id,$nama,$harga) = mysqli_fetch_row($result);
- mysqli_free_result($result);
- $price = number_format($harga,0,',','.');
- echo "<td>$p_id</td><td>$s_id</td><td>$nama</td><td>$price</td>\n";
- }
- ?>
- </tr></table><br>
- <a href=/pulsa>ulangi</a>
- </center>
- </body></html>
Advertisement
Add Comment
Please, Sign In to add comment