• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with Day & of the CI series

#1
[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');
            }        
        }        
}

&lt;?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;
    }  
}
?&gt;

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

&lt;html&gt;
    &lt;head&gt;
    
        &lt;title&gt;Family_view.php&lt;/title&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
                
    &lt;/head&gt;  
    
    &lt;body&gt;
    
        <div id="container">
        
            <p>Welcome to the Ashby and Rutzler Family Website</p>
                
            &lt;?php foreach($records as $row) : ?&gt;
                &lt;?php echo $row->surname; ?&gt;
            &lt;?php  endforeach; ?&gt;
        
        </div>
    &lt;/body&gt;
&lt;/html&gt;


Any help resolving this would be appreciated.


Thanks

Michael

#2
[eluser]davidbehler[/eluser]
What version of CI/PHP are you using?

Try CI 1.7.2, your problems should be fixed in there.

#3
[eluser]aussie1855[/eluser]
hi thanks for reply.

Im using version CI 1.7.2 and PHP 5.5

#4
[eluser]CroNiX[/eluser]
Those are normal if you are using php 5+ and have to do with the actual framework and nothing to do with your code. CI has code to make it compatible with php 4 and 5 so it will cause some warnings. Turn warnings off.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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