Skip to content

Commit

Permalink
Merge pull request #9 from leuterkil/Removefromcart
Browse files Browse the repository at this point in the history
Commit Complete #10(remove from cart)
  • Loading branch information
leuterkil authored Dec 29, 2018
2 parents 7130c83 + b4e8c5d commit 280b9b4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MainMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<br><center><span class="Welcome" align = "center"><b>Welcome <?=$username?> please fill free to explore our site</b></span><br>
<img src="https://wh1k8zidop.inscname.net/games/images/map_img_1138084_1501023103.jpg" alt=""><br><br>
<span class="Welcome"><b>Top 10 Sellers</b></span><br><br>
<span class="Welcome"><b>Top 5 Sellers</b></span><br><br>
<span class="Welcome"><b>Just added</b></span><br><br>
</center>
<table id="MainMenuProduct" border="3">
Expand Down
2 changes: 1 addition & 1 deletion cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<tr>
<td><?=$product_name?></td>
<td> <span id="decimalfont"> <b><?=$product_price?></span>.<?=$product_cents?>€</b></td>
<td> <a href="removefromcart.php">remove from cart</a> </td>
<td> <a href="removefromcart.php?id=<?=$product_id?>">remove from cart</a> </td>
</tr>
<?php
}
Expand Down
13 changes: 13 additions & 0 deletions removefromcart.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
include 'connection.php';
$prid=$_GET['id'];
$query = "delete from cart where product_idcart=".$prid;

$result = mysqli_query($con,$query);
if (!$result) {
mysqli_error($con);
}
else {
header("location:cart.php");
}
?>

0 comments on commit 280b9b4

Please sign in to comment.