Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/05/2010, 09:40
turfeano
 
Fecha de Ingreso: diciembre-2008
Mensajes: 190
Antigüedad: 15 años, 4 meses
Puntos: 6
Problema entre Clases y sesiones.

Buenas, tengo un incoveniente...
localmente tengo funcionando correctamente una clase asi:
doc_type.php:
Código PHP:
require_once($_SERVER['DOCUMENT_ROOT']."/carro/clase_carro.php"); 
session_start();
require_once(
$_SERVER["DOCUMENT_ROOT"]."/includes/constantes.php");    
if (!isset(
$_SESSION["id"])) {
        
$_SESSION["id"]=session_id();
        
$_SESSION["carrito"]=new Carro();

cuando lo subo a la web me sale el siguiente mensaje:
Código:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /public_html/carro_mio/clase_carro.php:51) in /public_html/includes/doc_type.php on line 6
Si hago el session_start antes de la declaracion de la clase, el carro no funciona (deja el siguiente error:
Código:
Fatal error: main() [<a href='function.main'>function.main</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition &quot;Carro&quot; of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /public_html/head_s.php on line 28
en head_s.php linea 28 tengo
Código PHP:
 $_SESSION["carrito"]->total_productos(); 
Gracias por su ayuda.