connect_error); } // Check connection if ($connection->connect_error) { die("Connection failed: " . $connection->connect_error); } ?> Cup WorX | cups & mugs  ☕ '; if (!empty($_GET['E'])) { // from email $_SESSION['current'] = 'email'; $returnPath = "shop-page.php"; $q1 = "SELECT product.ID, product.caption, product.picture, orders.* " . "FROM orders ". "INNER JOIN product ON Orders.ProductID=product.ID " . "WHERE orders.PrintImage='".$_GET['PrintImage']."'"; $r1 = $connection->query($q1) or die($connection->error); $a1 = $r1->fetch_assoc(); $_SESSION['ID']=$a1['ID']; if (empty($_SESSION['FAuser'])) $_SESSION['FAuser'] = "FA-".uniqid(); $_SESSION['CAPTION']=stripslashes($a1['caption']); $_SESSION['PICTURE']=$a1['picture']; $sk = explode('.', $_SESSION['PICTURE']); $_SESSION['json'] = $sk[0].'.json'; $_SESSION['PrintImage']=$_GET['PrintImage']; } else if ($_SESSION['current']=='index' || $_SESSION['current']=="shop-page") { $returnPath = "index.php"; $ID = $_GET['ID']; $q1 = "select * from product where ID = '$ID'"; $r1 = $connection->query($q1) or die($connection->error); $a1 = $r1->fetch_assoc(); $_SESSION['ID']=$_SESSION['current']=="orderUpdate"? $_SESSION['ID'] :$a1['ID']; if (empty($_SESSION['FAuser'])) $_SESSION['FAuser'] = "FA-".uniqid(); $_SESSION['CAPTION']=stripslashes($a1['caption']); $_SESSION['PICTURE']=$a1['picture']; $sk = explode('.', $_SESSION['PICTURE']); $_SESSION['json'] = $sk[0].'.json'; $_SESSION['PrintImage']=$_SESSION['FAuser']."-".$NextOrderCount; if ($_SESSION['current']=="shop-page") { $returnPath = "shop-page.php"; } $_SESSION['current']='showitem'; } else if ($_SESSION['current']=="orderUpdate" || $_SESSION['current'] == "newsetup") { $returnPath = "cart-page.php"; } else { $ID = $_SESSION['ID']; // 1007 $returnPath = "showitem.php?ID=" . $ID; } ?>