ozblue Posted March 17, 2007 Posted March 17, 2007 Hi installed STS 4.4 and being happly working everything out but when i click on "My Account" or "Checkout" i get this error, Warning: Cannot modify header information - headers already sent by (output started at /home/ubooksco/public_html/includes/classes/ProductsInCategory.php:45) in /home/ubooksco/public_html/includes/functions/general.php on line 33 had a look at the files listed ProductsinCategory <?php /* $Id: ProductsInCategory.php v1.0 2007/02/16 an object to store the products within each category once queried by the box dm_categories.php to avoid it being queried multiple times osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2007 osCommerce Released under the GNU General Public License */ class ProductsInCategory { var $pic_data = array(); function ProductsInCategory() { global $languages_id; $products_query = tep_db_query("select p2c.categories_id, p.products_id, p.products_status, pd.products_name as product, pd.products_id as product_id from " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c USING(products_id) LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd USING(products_id) where pd.language_id = '" . (int)$languages_id . "' AND p.products_status='1' order by p2c.categories_id, pd.products_name"); while ($product_info = tep_db_fetch_array($products_query)) { $this->addProductsInCategory($product_info['categories_id'], $product_info); } // end while ($product_info = tep_db_fetch_array($products_query)) } // end function ProductsInCategory function addProductsInCategory ($categories_id, $product_info) { $this->pic_data[$categories_id][] = array('products_id' => $product_info['products_id'], 'products_name' => $product_info['product'], // we already know the category but might be handy to have it here too 'products_category' => $categories_id); } // end function addProductsInCategory ($categories_id, $product_info) function getProductsInCategory($categories_id) { if (isset($this->pic_data[$categories_id])){ foreach ($this->pic_data[$categories_id] as $key => $_product_data) { $product_data[] = $_product_data; } // end foreach return $product_data; }else{ return false; } } // end function getProductsInCategory($categories_id) } // end Class ProductsInCategory ?> and General.php <?php /* $Id: general.php,v 1.231 2003/07/09 01:15:48 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ //// // Stop from parsing any further PHP code function tep_exit() { tep_session_close(); exit(); } //// // Redirect to another page or site function tep_redirect($url) { if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) { tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false)); } if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url $url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL } } header('Location: ' . $url); [color="#FF0000"] // <<<LINE 33[/color] tep_exit(); } //// // Parse the data used in the html tags to ensure the tags will not break function tep_parse_input_field_data($data, $parse) { return strtr(trim($data), $parse); } function tep_output_string($string, $translate = false, $protected = false) { if ($protected == true) { return htmlspecialchars($string); Help on this would be appreciated thx Paul Contributions installed; Register_globals V1.5 STS V4.4 Dynamenu V1_11 Productsindynamenutoo_v1.0 Dynamenu Quote
ozblue Posted March 18, 2007 Author Posted March 18, 2007 Hi i found a solution to my problem, it was a whitespace error caused when i was editing a file if u hilite the text in the ProductsinCategory file i posted u will see "whitespace" after the last "?> when there should be no spaces. Paul Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.