I have created this code so that when dealing with session variables you do not need to have 100 different variables.
Some may think there are other ways to do this and if you do please respond and let me know how i can do this differently or more efficient.
to use this code you will need to edit the include/global.php file and setup the directory variables.
you can then navigate to the main page and it will print out the $site object.
This template has a base class called $site which also has sub classes such as $user, $cart, $db, and anything else you may want to add.
When you use these objects you can use $site->user->function or i have made it easy and you can use just $user->function, these values are stored in a session so that you can use the values you set from page to page.
Please let me know what you think of the attached code.
Joseph Crawford wrote :1112
if anyone has any questions reguarding this code/article feel free to contact me or post your questions here as comments ;)
Jose Santos wrote :1113
It`s very interesting !! :-))
But dont needed the database class, because the PEAR of the PHP have an package DB, wich implement similar functios to any database (MySql, Oracle, PostgreSql, ...)
Joseph Crawford wrote :1116
this is true, you do not need the database class unless ofcourse you dont want to rely on the server having PEAR installed :)