Hello,
I al new to classes anb have read several tutorials, message post etc. to get me started ok. I do have the following questions though, to deepen my understanding :
1) I have created my own session class which works in realtion with my database and a database connection class I created. Now, I need to pass my session object across the url to conserve it from page to page :
<form name=frmCompte action="login.php?submit=yes&SSID=<?=base64_encode(serialize(&$SSID));?>" method=post>
if (empty($SSID))
$SSID = new sessionObj();
else {
$SSID = unserialize(base64_decode($SSID));
}
This works fine, apart from the fact the my URL is about 650 characters long. I would like to just pass the object reference, but it seems to pass the same character string if I pass :
SSID=<?=base64_encode(serialize(&$SSID));?>
or
SSID=<?=base64_encode(serialize($SSID));?>
Doesn't the url have a limit off 255 characters???? I am scared I will lose my full object serialization !!
2) Where are object instances stored in PHP? Is there any way of returning all of the created object instances of a class and looping through them to check a particular value?
3) Is it important to 'destroy' unused objects or will php do that istelf? For example : On each page where I query my db, I create a new db object which has methods for select, insert etc. What happens to all those object instances? Say, there are 20 people connected to the site and each time they call a page a new db object instance is created, what happens to all the old ones?
Thanks you very much, I know these are probably basic questions, but I can't seem to figure out the answers from what i have read so far !!
Many thanks,
Debbie