Bluehost.com Web Hosting $6.95

Sessions and objects

This is a discussion on Sessions and objects within the PHP General forums, part of the PHP Programming Forums category; I create a new object and then assign it to a session var $customer = new Customer($_GET['facilityID'], $_GET['customerID']); $...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-15-2003
Matt Silva
 
Posts: n/a
Default Sessions and objects

I create a new object and then assign it to a session var

$customer = new Customer($_GET['facilityID'], $_GET['customerID']);
$_SESSION['acceptPayment']['customer'] = $customer;

but later when I access that session var [in the the same file but in a different function and different instance], php gives me
an error saying:

"The script tried to execute a methode or access a property of an incomplete object. Pleas ensure that the class definition
lt;bgt;customerlt;/bgt; of the object you are trying to operate on was loaded _before_ the session was started
at <filepath>/acceptPayment.php line 103"

I did a little reading (rtfm) on php.net and saw that if session.auto_start is turned on, you couldn't use Objects with
sessions. Well I checked my ini and the session.auto_start was set to 0, so I am now scratching my head in confusion.

I require_once the Customer class and start the session after the requires and includes, so then I thought ok require_once
so I change it to require and then it doesn't load the class the for some reasone (sigh). Any Ideas?

Thanks for your help in advance
Matt

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:17 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0