onlyican Posted December 11, 2006 Share Posted December 11, 2006 Hey guysI have an inc_header.php fileAs follows[code]<?phpsession_start();error_reporting(2047);require("../includes/globals.php");require("../includes/MySQL.php");$DB = new MySQL;$DB->connect();require("../includes/Sessions.php");$in = $_POST;$user = new Sessions;$user->get_current_session();require("../includes/functions.php");$left_links = isset($left_links) ? $left_links : "";?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Site Admin</title><link href="../css/admin.css" rel="stylesheet" type="text/css" /></head><body><div id='PageFrame'><div id='Logo'></div><div id='LeftLinks'><?phprequire("includes/inc_left_nav.php");?></div><div id='Content'>[/code]And I am getting the following error[quote]Notice: Use of undefined constant object - assumed 'object' in W:\www\stontronics\administration\includes\inc_header.php on line 15[/quote]Line 15 is$user = new Sessions;So I had a look at sessions.phpand I saw something I have not seen beforeAnd the file Sessions.php is like this[code]<?phpclass Sessions{ var $db = object; var $input = array(); var $errors = array(); var $me = array(); var $session = array(); function Sessions() { global $DB, $in, $lib, $email, $debug; $this->db = $DB; $this->input = $in; $this->session = &$_SESSION; $this->lib = $lib; $this->email = $email; $this->debug = $debug; $this->debug = false; }?>[/code]The word object;I have checked this on PHP 5.1.1 and 4.4.3Anyone know a way around this.Note:In the function Sessions()where we add$this->db = $DB;And From the inc_header$DB = new MySQL;NowWithout having to Change the error_reportingHow do I clear this error message Link to comment https://forums.phpfreaks.com/topic/30239-undefined-object/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.