[eluser]yudahebat[/eluser]
i hav a function like this
Code:
function v_cart()
{
$data['css'] = $this->css;
$data['base'] = $this->base;
$data['menu_web'] = $this->menu;
$data['myrobots'] = '<meta name="robots" content="noindex,nofollow">';
$data['mywebtitle'] = 'mrputucar | Your cart';
$this->output->enable_profiler(TRUE);
$this->session->sess_create();
$this->session->set_userdata(array('nama' => 'avanza','photo' => 'ii.jpg','harga' => '500'));
$this->load->view('v_cart',$data);
}
and my view
Code:
<table width="645" border="0" cellpadding="0" cellspacing="0" class="tabel" >
<tr>
<td width="110" class="tabel" align="center"><p>Car Type</p></td>
<td width="110" class="tabel" align="center"><p>Rent date</p></td>
<td width="110" class="tabel" align="center"><p>Return date</p></td>
<td width="100" class="tabel" align="center"><p>Duration</p></td>
<td width="100" class="tabel" align="center"><p>Price/day</p></td>
<td width="110" class="tabel" align="center"><p>Suhtotal</p></td>
</tr>
<tr>
<td width="110" class="tabel"><p><? $this->session->userdata('nama');?></p></td>
<td width="100" class="tabel"><p>..</p></td>
<td width="100" class="tabel"><p>..</p></td>
<td width="120" class="tabel"><p>..day</p></td>
<td width="100" class="tabel"><p>$<? $this->session->userdata('harga');?></p></td>
<td width="110" class="tabel"><p>$..</p></td>
</tr>
<tr>
<td colspan="4" class="tabel2"><p><?php echo form_submit('', 'Update your Cart'); ?></p></td>
<td class="tabel2"><p>Total</p></td>
<td class="tabel2"><p>$...</p></td>
</tr>
</table>
but when I run it. the session not work
Code:
<? $this->session->userdata('nama');?>
and
Code:
<? $this->session->userdata('harga');?>
didn't show anything,whats wrong??
anyone cant help me?