Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $page_title="Add to Cart";
- include("header.inc");
- if(!isset($_SESSION))
- {
- session_start();
- }
- else
- {
- }
- ?>
- <div id="content_wrap">
- <div id="main-content">
- <?php
- $id = $_GET['id'];
- array_push($_SESSION['cart_cake'], $id);
- //connect to the db server
- $db = mysqli_connect("localhost", "root", "", "shop") or die(mysqli_error());
- //execute the select
- $q = "select * from $type where id = '$id'";
- $results = mysqli_query($db, $q) or die(mysqli_error());
- while($row = mysqli_fetch_array($results, MYSQL_ASSOC))
- {
- $name = $row['name'];
- print "<h3> $name added </h3>";
- print "</br>";
- print "Redirecting to Cart";
- header( "refresh:1;url=cart.php" );
- }
- ?>
- </div>
- </div>
- <?php
- include("footer.inc");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement