CodeIgniter Forums
Displaying session on view with array - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Displaying session on view with array (/thread-40826.html)



Displaying session on view with array - El Forum - 04-19-2011

[eluser]redraw[/eluser]
Hallo All,

Sorry for my bad English
i have an ccontroller
Code:
$data = $this->fungsi->accept_data(array_keys($_POST));
        
    $code = $this->input->post('code');
    $keterangan = $this->input->post('keterangan');
    $keterangan = strtoupper($keterangan);
    $nilai = $this->input->post('nilai');
    $nilai = str_replace(',','',$nilai);
            
    
    $data = array(
    'code'=>$code,
    'keterangan'=>$keterangan,
    'nilai'=>$nilai
    );
        
        
    $this->session->set_userdata($data);
    $this->load->view('haluser/gl_transenjur_umum', $data);
i want show the session on view, there is the view code..
Code:
<?php foreach($this->session->userdata() as $rows):?>
<td>&lt;?php echo $rows['code'];?&gt;</td>
<td>&lt;?php echo $rows['keterangan'];?&gt;</td>
<td>&lt;?php echo $rows['nilai'];?&gt;</td>
<td align="center">
&lt;?php endforeach; ?&gt;


but it not show..
please help

Thank you


Displaying session on view with array - El Forum - 04-20-2011

[eluser]danmontgomery[/eluser]
Code:
foreach($this->session->all_userdata() as $rows)



Displaying session on view with array - El Forum - 04-21-2011

[eluser]redraw[/eluser]
thank you