product_categories.category_id'; // get a database connection $db_link = DatabaseTools::getConnection(); // execute the query $query_results = mysql_query($q); // close database connection DatabaseTools::closeConnection($db_link); // create an associative array with the results $rows = array(); while ($result = mysql_fetch_assoc($query_results)) { $rows[] = $result; } // User agent echo "User-agent: * \r\n"; // display the links that need to be excluded foreach ($rows as $row) { // get the category and product IDs $product_id = $row['id']; $category_id = $row['secondary_category_id']; $product_name = $row['name']; $category_name = $row['secondary_category_name']; // create disallow definition $url = make_category_product_url($category_name, $category_id, $product_name, $product_id); $disallow = str_replace(SITE_DOMAIN, '', $url); echo "Disallow: " . $disallow . "\r\n"; } ?> Disallow: /cart.php