• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I fix this Header Problem ?

#1
[eluser]vincej[/eluser]
On my development server I do not get this problem, however, I have recently moved my site onto an ISP in a testing environment and now I am getting a nasty error:

Code:
Message: Cannot modify header information - headers already sent by (output started at /services9/webpages/g/r/my-site.com/public/CLFarms/system/core/Exceptions.php:185)

I have looked that the controller being called and indeed there are 3 redirects, but I do not understand why they don't give me an error locally but they do on my remote ISP testing server,

What is also relevant is that if you reload the page the errors go away and the page loads normally.

Can someone with more experience give me advice as to where I am going wrong ?

MANY MANY THANKS !

Controller

Code:
function cart($productid=0){
        
  if (!isset($_SESSION['userid'])){
  $this->session->set_flashdata('error', 'You will need to login to place an order' );
  redirect('welcome/index','refresh') ;}
  
if ($productid > 0){               // IF PRODUCT PRESENT THEN ADDS TO CART
            
  $productid = $this->uri->segment(3);
  $fullproduct = $this->MProducts->getProductUserCode($productid);
  
    
  $this->MOrders->updateCart($productid,$fullproduct);  // UPDATE CART ADDS ONE ITEM TO CART IF THERE IS NONE AND INCREMENTS COUNT +1 IF ITEM IS IN CART ALREADY.
  redirect('welcome/product/'.$productid, 'refresh');  
}
else{                 // GOES TO 'VIEW CART' AND SHOWS CONTENTS OF CART
  $data['title'] = "MY SITE | Shopping Cart";
  if (count($_SESSION['cart'])){
   $data['main'] = 'shoppingcart';
   $data['location'] = $this->MCustomer->GetCustomerPickupLocation(); // This delivers a full text version of the location not an ID //  
   $data['deliverydates'] = $this->MPickup->GetLocationDates($data['location']);
   $data['navlist'] = $this->MCats->getCategoriesNav();
   $this->load->vars($data);
   $this->load->view('template');
  }else{
   redirect('welcome/index','refresh');
  }
}
  }



Messages In This Thread
How do I fix this Header Problem ? - by El Forum - 06-26-2012, 10:23 AM
How do I fix this Header Problem ? - by El Forum - 06-27-2012, 07:03 AM
How do I fix this Header Problem ? - by El Forum - 06-27-2012, 07:12 AM
How do I fix this Header Problem ? - by El Forum - 06-27-2012, 10:13 AM
How do I fix this Header Problem ? - by El Forum - 06-27-2012, 12:17 PM
How do I fix this Header Problem ? - by El Forum - 06-27-2012, 12:36 PM
How do I fix this Header Problem ? - by El Forum - 06-27-2012, 01:45 PM
How do I fix this Header Problem ? - by El Forum - 06-27-2012, 02:01 PM
How do I fix this Header Problem ? - by El Forum - 06-27-2012, 02:04 PM
How do I fix this Header Problem ? - by El Forum - 06-27-2012, 02:18 PM
How do I fix this Header Problem ? - by El Forum - 06-27-2012, 02:23 PM
How do I fix this Header Problem ? - by El Forum - 06-27-2012, 09:05 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.