findOneById($id); if ( !is_object($product) ) { header('Location: categories.php'); } $smarty = new Smarty; $smarty->assign('loggedin', isset($_SESSION['username'])); $smarty->assign('product', $product); $smarty->assign('id', $id); $smarty->assign('catid', $catid); $smarty->display('productdetails.tpl') ?>