Re: Re:[PHP]clases en sesiones

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



WILD GUESS

Search on php.net for __autoload

I think that will let you figure out a way to get the auto_start
session to automatically load your .class.php files, when it needs
them.

On Fri, January 5, 2007 7:04 am, deinet wrote:
> Hi, thank you chucre, but this not is the solution, the
> session.auto_start
> is On, I don't need use session_start() because it is automatic.
>
> This is my script:
>
> <?
>
> include_once 'usuario.class.php';
>
> include_once 'carrito.class.php';
>
> //session_start();
>
> if (!session_id())
>
> {
>
>             session_start();
>
> }
>
> if (!isset($_SESSION["ocarrito"])){
>
>             $_SESSION["ocarrito"] = new carrito();
>
> }
>
>
>
> if (!isset($_SESSION["elusuario"])){
>
>             $_SESSION["elusuario"] = new usuario();
>
> }
>
> ?>
>
> for your class work, is necessary verify the session_id, like this:
>
> if (!session_id())
>    session_start();
>
>
>
> 2007/1/5, deinet < <mailto:lista_php@xxxxxxxxxx>
> lista_php@xxxxxxxxxx>:
>
> Hello list, i have a problem with sessions and class. I used to work
> with a
> server with session.auto_start=Off, and now I had to move all my sites
> to
> another server with session.auto_start=On, and I have this problem
> with the
> session:
>
>
>
> Fatal error: Unknown(): The script tried to execute a method or access
> a
> property of an incomplete object. Please ensure that the class
> definition
> carrito of the object you are trying to operate on was loaded _before_
> the
> session was started in <archive> on line 43
>
>
>
> The problem is the class is charged after the beginning of the
> session, but
> I don't know what to do to make it work, please help me.
>
>
>
> P.D.:  To put the session.auto_start in Off is not a solution because
> the
> servers administrators don't admit that.
>
>
>
> I hope you will understand my problem, sorry for my english.
>
>
>
> Thank you very much, Carlos.
>
>
>
>
> --
> Fernando Chure
> PSL/CE
>
>
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux