error con variable de sesion tipo objeto
Publicado por jose luis (65 intervenciones) el 22/06/2020 23:31:06
tengo el siguiente codigo:
y su correspondiente declaracion:
y al ejecutar el codigo me manda el siguiente error:
Notice: main(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "articulo" 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
¿como puedo solucionarlo?
un saludo.
1
2
$_SESSION["art"]->id=$id_articulo;
$_SESSION["art"]->cantidad=$cantidad;
y su correspondiente declaracion:
1
2
3
4
5
6
class articulo
{public $id;
public $cantidad;
}
$_SESSION["art"]=new articulo();
y al ejecutar el codigo me manda el siguiente error:
Notice: main(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "articulo" 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
¿como puedo solucionarlo?
un saludo.
Valora esta pregunta


0