[eluser]shinokada[/eluser]
I am using php session.
In a view when I use the following code, I get the error notice.
It is not displayed, but when I see the source code, it's there.
In a view:
Code:
$totalprice = $_SESSION['totalprice'];
Error
Code:
<h4>A PHP Error was encountered</h4>
<p>Severity: Notice</p>
<p>Message: Undefined index: totalprice</p>
<p>Filename: controllers/mycontroller.php</p>
<p>Line Number: 326</p>
If I put it a controller, I get another error.
In a controller:
Code:
$data['totalprice']= $_SESSION['totalprice'];
Error
Code:
<h4>A PHP Error was encountered</h4>
<p>Severity: Notice</p>
<p>Message: Undefined index: totalprice</p>
<p>Filename: controllers/mycontroller.php</p>
<p>Line Number: 326</p>
The second case is worse since the doc type and other header section is gone.
Can anyone tell me how to do it?
(Please don't ask me or why I am not using ci session class.)