Guest User

Untitled

a guest
Jun 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <?php
  2. //This is the showcart.php file
  3. session_start();
  4.  
  5. require('header.php');
  6. define('DB_HOST', 'llll');
  7. define('DB_USER', 'llll');
  8. define('DB_PASSWORD', 'llll');
  9. define('DB_NAME', 'llll');
  10. $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
  11. require('functions.php');
  12.  
  13. echo '<h2>Your shopping cart</h2>';
  14. showcart(); //This function comes from the functions.php file
  15.  
  16. if(isset($_SESSION['ordernum'])) {
  17. $query = "SELECT * FROM orderitems WHERE order_id = '" . $_SESSION['ordernum'] . "'";
  18. $result = mysqli_query($dbc, $query);
  19. $numrows = mysqli_num_rows($result);
  20.  
  21. if($numrows >= 1) {
  22. echo '<h3><a href="checkoutaddress.php">Go to checkout</a></h3>';
  23. }
  24. }
  25.  
  26. require('footer.php');
  27. ?>
Add Comment
Please, Sign In to add comment