<?php $mahang = $_GET['tim']; $q = timkiem($mahang); while ($row = mysql_fetch_array($q)) { ob_start(); ?> <div> <div id="{masp}" class="sp"><a href="?b=ctsp&masp={masp}"> <div class="hinh"><img src="images/{hinh}" width="200px" height="220px"/></div> <hr /> <div class="ten" size: 10px> {ten}</div> <div class="gia">Gia : {gia} vnd</div></a> </div> </div> <?php $s = ob_get_clean(); $s = str_replace("{masp}", $row["masp"], $s); $s = str_replace("{hinh}", $row["hinh"], $s); $s = str_replace("{ten}", $row["tensp"], $s); $s = str_replace("{gia}", $row["giasp"], $s); echo $s; } ?>
<?php $tukhoa = $_GET['search']; $tim = timkiem($tukhoa); while ($row = mysql_fetch_array($tim)) { ob_start(); ?> <div class="sp" id="{masp}"><a href="index.php?q=tt&masp={masp}"> <table width=175 height=220 border=0 cellspacing=0 cellpadding=0 background="images/box.gif" style="border:1px dotted #999\"> <tr> <td height=170><img src="images/{hinh}" width=150px height=150 border=0></td> </tr> <tr> <td height=25 style="font-size:14px; color:#F00;">{ten}</td> </tr> <tr> <td height=25>Giá: {gia} vnd</td> </tr> </table> </div></a> <?php $s = ob_get_clean(); $gia = number_format($row['gia'], 0, '', '.'); $s = str_replace("{masp}", $row["masp"], $s); $s = str_replace("{hinh}", $row["hinh"], $s); $s = str_replace("{ten}", $row["tensp"], $s); $s = str_replace("{gia}", $gia, $s);