include("lw_config.php"); ?> $prod_code = ""; if (isset($_GET['p'])){ $prod_code = strtolower($_GET['p']); } else { header("Location: index.php"); // Redirect browser exit; // Make sure that code below does not get executed when we redirect. } $sql = "SELECT `products`.*, `categories`.`name` AS cat_name "; $sql .= "FROM `products`, `categories` "; $sql .= "WHERE ((`products`.`category_id`=`categories`.`category_id` ) AND (`products`.`code` LIKE '$prod_code'))"; $result = mysql_query($sql, $db); if (!$result) die("Product not found
|