• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i have problem with session i use codelginter

#1
[eluser]Unknown[/eluser]
In the name of Allah


i have probem with session

A PHP Error was encountered
Severity: Notice

Message: Undefined property: MhClass::$session

Filename: libraries/MhClass.php

Line Number: 19


Fatal error: Call to a member function userdata() on a non-object in C:\AppServ\www\code\system\application\libraries\MhClass.php on line 19



C:\AppServ\www\code\system\application\models\MHModel.php



##################################################################
<?php

class MHModel extends Model
{
function __construct()
{
parent::Model();
}
function SetIs()
{
return $this->db->get("setting");

}
}
?>





#################################################################









C:\AppServ\www\code\system\application\libraries\MhClass.php


############################################
<?php

class MhClass extends Controller
{
protected $data=array();
function __construct()
{
parent::Controller();
$this->load->model("MHModel");
$this->data['MH_Style']=$this->Style();
$this->session->userdata('M');
}
function Style()
{
return "templtes/main/";
}

function Lang_dir()
{
return "site_lang/arabic/";
}
function Data()
{
return $this->data;
}
}

?>
###############################################

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$



C:\AppServ\www\code\system\application\controllers\helal.php

######################################################

<?php

class helal extends Controller {

function __construct()
{
parent::Controller();
$this->load->library("MhClass");
$this->style =$this->MhClass->Style();
$this->lang_dir =$this->MhClass->Lang_dir();
$this->data =$this->MhClass->Data();
$this->data['SETTING'] =$this->MHModel->SetIs();
$this->lang->load("index",$this->lang_dir);
}

function index()
{
$this->load->view('welcome_message');
$row=$this->MHModel->SetIs();
print_r($row->result_array());
}
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */
?>

#####################################################

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


C:\AppServ\www\code\system\application\controllers\helal.php


####################################################

<?php

class helal extends Controller {

function __construct()
{
parent::Controller();
$this->load->library("MhClass");
$this->style =$this->MhClass->Style();
$this->lang_dir =$this->MhClass->Lang_dir();
$this->data =$this->MhClass->Data();
$this->data['SETTING'] =$this->MHModel->SetIs();
$this->lang->load("index",$this->lang_dir);
}

function index()
{
$this->load->view('welcome_message');
$row=$this->MHModel->SetIs();
print_r($row->result_array());
}
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */
?>



##########################################################

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

C:\AppServ\www\code\system\application\controllers\Home.php


####################################################

<?php
class home extends Controller
{
protected $style =false;
protected $data =array();
protected $lang_dir =false;
function __construct()
{
parent::Controller();

$this->load->library("MhClass",null,'MhClass');
$this->load->model("MHModel");
$this->style =$this->MhClass->Style();
$this->lang_dir =$this->MhClass->Lang_dir();
$this->data =$this->MhClass->Data();

$this->data['SETTING'] =$this->MHModel->Get_St();
$this->lang->load("index",$this->lang_dir);
$this->session->set_userdata(array("M"=>"MOHAMED"));

}
function index()
{

$this->data['pege_title']="MO ";
$this->data['pege_keys']="F ";
$this->data['pege_desc']=" d";
$this->load->view($this->style."homepage.htm",$this->data);

}
}
?>

#############################################################


&& when i open

http://localhost//code/system/application/controllers/Home.php

i got error



Fatal error: Class 'Controller' not found in C:\AppServ\www\code\system\application\controllers\Home.php on line 11



and other file

http://localhost//code/system/application/controllers/helal.php

its same


Fatal error: Class 'Controller' not found in C:\AppServ\www\code\system\application\controllers\helal.php on line 3

can i fine solution

#2
[eluser]Ben Edmunds[/eluser]
I think you posted this on the wrong forum...


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.