📄 product_details.php
字号:
<?/* product_details.php (c) 2000 Ying Zhang (ying@zippydesign.com) * * TERMS OF USAGE: * This file was written and developed by Ying Zhang (ying@zippydesign.com) * for educational and demonstration purposes only. You are hereby granted the * rights to use, modify, and redistribute this file as you like. The only * requirement is that you must retain this notice, without modifications, at * the top of your source code. No warranties or guarantees are expressed or * implied. DO NOT use this code in a production environment without * understanding the limitations and weaknesses pretaining to or caused by the * use of these scripts, directly or indirectly. USE AT YOUR OWN RISK! *//****************************************************************************** * MAIN *****************************************************************************/include("../application.php");/* if no product id is specified, go back to the main page */if (empty($id)) { header("Location: $CFG->wwwroot"); die;}$prod = load_product($id);$DOC_TITLE = $prod ? "Product Details: " . $prod->name : "Product Not Found";include("$CFG->templatedir/header.php");include("templates/product_details.php");include("$CFG->templatedir/footer.php");/****************************************************************************** * FUNCTIONS *****************************************************************************/function load_product($id) {/* load up the product details for a product with id $id and return it as * an object, or false if the object couldn't be loaded (ie. it's not found) */ $qid = db_query(" SELECT p.id ,p.name ,p.description ,p.price ,p.on_special ,pc.category_id FROM products p ,products_categories pc WHERE p.id = pc.product_id AND p.id = '$id' "); if ($qid) { return db_fetch_object($qid); } else { return false; }}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -