-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathre16.php
64 lines (55 loc) · 1.72 KB
/
re16.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
$connection = mysqli_connect('localhost', 'root', '');
if (!$connection){
die("Database Connection Failed" . mysqli_error($connection));
}
$select_db = mysqli_select_db($connection, 'project');
if (!$select_db){
die("Database Selection Failed" . mysqli_error($connection));
}
$sql = "SELECT * FROM products WHERE prod_id=4.1";
$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="addtocart.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">TABLETS</title>
<style>
div {
background-color: #fff;
background-color: rgba(255,255,255,0.5);
margin-top: 30px;
margin-bottom: 30px;
margin-right: 30px;
margin-left: 30px;
}
body{
background-image: url("/pad.jpg");
}
</style>
</head>
<body align="center">
<form action = "/cart.php" method="post">
<div>
<input type = "submit" value="VIEW CART">
</div>
</form>
<form action = "/category.php" method="post">
<div>
<input type = "submit" value="CONTINUE SHOPPING">
</div>
</form>
<form action = "/checkout.php" method="post">
<div>
<input type = "submit" value="CHECKOUT">
</div>
</form>
</body>
</html>