topical media & game development
professional-search-14-seophp-robots.php / php
<?php
// set propert content type
header('Content-type: text/plain');
// include config file
require_once 'include/config.inc.php';
// load database tools
require_once('include/database_tools.inc.php');
// load the URL factory
require_once 'include/url_factory.inc.php';
// this query returns product_id and secondary_category_id data which needs to be
// excluded using robots.txt
db_link = DatabaseTools::getConnection();
// execute the query
q);
// close database connection
DatabaseTools::closeConnection(rows = array();
while (query_results)) {
result;
}
// User agent
echo "User-agent: * \r\n";
// display the links that need to be excluded
foreach (row)
{
// get the category and product IDs
row['id'];
row['secondary_category_id'];
row['name'];
row['secondary_category_name'];
// create disallow definition
category_name, product_name, disallow = str_replace(SITE_DOMAIN, '', disallow . "\r\n";
}
?>
Disallow: /cart.php
(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.