Classes named Session
Moderator: General Moderators
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
Classes named Session
does that cause issues in PHP5?because my class called session is suddenly displaying all it's code on the webpage when I upgraded to version 5 :-/
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
thanks for the replies and sorry for the long delay. i only work at this job two days a week so it's been a while since I've had access to the source code. Either way...going back we find..
as you can see up until it gets to $this->time it's fine..something about that arrow is <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> it off though....Any more ideas? I've renamed the class..no dice...
that's the beginning of the output on the page and that goes all the way till the code ends..i will now show relevant code up till that point..time = time(); $this->startSession(); } /* *
Code: Select all
*
* Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
* Last Updated: August 19, 2004
*/
include("database.php");
include("mailer.php");
include("form.php");
class Session
{
var $username; //Username given on sign-up
var $userid; //Random value generated on current login
var $userlevel; //The level to which the user pertains
var $time; //Time user was last active (page loaded)
var $logged_in; //True if user is logged in, false otherwise
var $userinfo = array(); //The array holding all user info
var $url; //The page url current being viewed
var $referrer; //Last recorded site page viewed
/**
* Note: referrer should really only be considered the actual
* page referrer in process.php, any other time it may be
* inaccurate.
*/
/* Class constructor */
function Session(){
$this->time=time();
$this->startSession();-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
I just missed it when copying
And I removed all comments before the troubled section..still same error.just spitting the code to the page...I FIGURED IT OUT! mwua ha ha...I noted he was using short tags..so I thought to myself....do I have short tags enabled? no sir I do not. therefore I replaced all short tags with long tags and tada. Heh... Man I feel like an idiot..
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
d11wtq, do you say if an user defined class is named session, it will not be a problem even if there already exists a class with name session used by PHP?
How the distinction is made? I just want to know how are you guys handling namespaces in PHP. I do not think even PHP 5 does have that feature. If I want to create two different classes with the same name, how can I do that if I am not able to use packages which I think is not available in PHP 5.
How the distinction is made? I just want to know how are you guys handling namespaces in PHP. I do not think even PHP 5 does have that feature. If I want to create two different classes with the same name, how can I do that if I am not able to use packages which I think is not available in PHP 5.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US