-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstimulants.php
45 lines (40 loc) · 1.29 KB
/
stimulants.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
$connection = mysqli_connect('localhost', 'root', '');
if (!$connection){
die("Database Connection Failed" . mysqli_error($connection));
}
$select_db = mysqli_select_db($connection, 'pharmacy');
if (!$select_db){
die("Database Selection Failed" . mysqli_error($connection));
}
$sql = "SELECT * FROM products WHERE category_id=5";
$res = mysqli_query($connection, $sql);
?>
<?php while($r = mysqli_fetch_assoc($res)){ ?>
<div class="col-sm-6 col-md-3" align="center">
<h3><?php echo $r['prod_name'] ?></h3>
<p><?php echo "price :".$r['price'] ?></p>
<p><a href="addtocartm.php?id=<?php echo $r['prod_id'];?>&name=<?php echo $r['prod_name'];?>&price=<? echo $r['price']; ?>" class="btn btn-primary" role="button">Add to Cart</a></p>
</div>
<?php } ?>
<html>
<head>
<meta charset="UTF-8">
<title align="center">Antipyretics</title>
<style>
div {
background-color: #fff;
background-color: rgba(255,255,255,0.5);
margin-top: 70px;
margin-bottom: 70px;
margin-right: 70px;
margin-left: 70px;
}
body{
background-image: url("sti.jpg");
}
</style>
<body>
<?php echo file_get_contents('topmenu.html'); ?>
</body>
</html>