[eluser]aussie1855[/eluser]
I copied and pasted the new items from the day 7 series and I am now getting the following errors.
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\CI\system\codeigniter\Common.php on line 130
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\CI\system\codeigniter\Common.php on line 136
A PHP Error was encountered
Severity: 8192
Message: Function set_magic_quotes_runtime() is deprecated
Filename: codeigniter/CodeIgniter.php
Line Number: 60
A PHP Error was encountered
Severity: 8192
Message: Assigning the return value of new by reference is deprecated
Filename: libraries/Loader.php
Line Number: 255
A PHP Error was encountered
Severity: 8192
Message: Assigning the return value of new by reference is deprecated
Filename: database/DB.php
Line Number: 133
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\CI\system\codeigniter\Common.php:130)
Filename: libraries/Session.php
Line Number: 408
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\CI\system\codeigniter\Common.php:130)
Filename: libraries/Session.php
Line Number: 662
here are my php files:
Code:
//family.php
<?php
class Family extends Controller {
function index() {
$this->load->model('family_model');
$data['records'] = $this->family_model->getAll();
$this->load->view('family_view', $data);
}
function __construct()
{
parent::Controller();
$this->is_logged_in();
}
function members_area()
{
$this->load->view('logged_in_area');
}
function another_page() // just for sample
{
echo 'good. you\'re logged in.';
}
function is_logged_in()
{
$is_logged_in = $this->session->userdata('is_logged_in');
if(!isset($is_logged_in) || $is_logged_in != true)
{
echo 'You don\'t have permission to access this page. <ahref="../login">Login</a>';
die();
//$this->load->view('login_form');
}
}
}
<?php
//family_model.php
class Family_model extends Model {
function getAll() {
$this->db->select('*');
$this->db->from('users');
$this->db->group_by('surname');
$this->db->order_by('surname','asc');
$query = $this->db->get();
if($query->num_rows() > 0) {
foreach ($query->result_array() as $row) {
$data[] = $row;
}
return $data;
}
}
function validate()
{
$this->db->where('username', $this->input->post('username'));
$this->db->where('password', md5($this->input->post('password')));
$query = $this->db->get('membership');
if($query->num_rows == 1)
{
return true;
}
}
function create_member()
{
$new_member_insert_data = array(
'first_name' => $this->input->post('first_name'),
'last_name' => $this->input->post('last_name'),
'email_address' => $this->input->post('email_address'),
'username' => $this->input->post('username'),
'password' => md5($this->input->post('password'))
);
$insert = $this->db->insert('membership', $new_member_insert_data);
return $insert;
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Family_view.php</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div id="container">
<p>Welcome to the Ashby and Rutzler Family Website</p>
<?php foreach($records as $row) : ?>
<?php echo $row->surname; ?>
<?php endforeach; ?>
</div>
</body>
</html>
Any help resolving this would be appreciated.
Thanks
Michael