topical media & game development
professional-search-14-seophp-category.php / php
<?php
// load the catalog library
require_once 'include/catalog.inc.php';
// load the URL factory library
require_once 'include/url_factory.inc.php';
// load the URL redirect library
require_once 'include/url_redirect.inc.php';
// load pager library
require_once 'include/simple_pager.inc.php';
// retrieve the category details
_GET['category_id'];
category_id);
categories[0];
category['name'];
// retrieve the page number; if none is provided, assume 1
_GET['page']) ? proper_url = make_category_url(category_id, proper_url);
// retrieve the products in the category
category_id);
// send a 404 if the category does not exist.
if (!category_name ?> - Cookie Ogre's Warehouse</title>
</head>
<body>
<h1>
<?php echo category_name ?></b> category:
<?php
// load the URL factory
require_once 'include/url_factory.inc.php';
// display each product
echo "<ul>";
// calculate which products to display on this page
page - 1) * PRODUCTS_PER_PAGE;
start + PRODUCTS_PER_PAGE, count(i = i < i++ )
{
category_name, products[products[url . '"' . '>' . i]['name'] . '</a>' .
'</li>';
}
echo "</ul>";
// use the SimplePager library to display the pager
products, PRODUCTS_PER_PAGE, 'make_category_url');
echo page, category_name,
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.