CodeIgniter Forums
TOTAL NEWBIE PLEASE HELP - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: TOTAL NEWBIE PLEASE HELP (/showthread.php?tid=12110)



TOTAL NEWBIE PLEASE HELP - El Forum - 10-06-2008

[eluser]sHoyRu777[/eluser]
hello.. i am really a noob in CI and i am practicing CI by making a shopping cart system or what do you call that.. (dont mind my english)... i want to make my cart session, i have already done that with native php coding(heres my code) :

<?
if(isset($_GET['product_id'])){
$_SESSION['product'][$_GET['product_id']]++;
}
?>
<?
if(isset($_POST['btn'])){
switch($_POST['btn']){
case "Update" :
foreach($_POST['hidden_lodge'] as $Key => $Index){
$_SESSION['product'][$Index] = $_POST['txt_qty'][$Key];
}
break;
case "Remove" :
foreach($_POST['chk_remove'] as $index){
unset($_SESSION['product'][$index]);
}
break;
case "Continue Shopping" :
echo "[removed][removed]='products.php'[removed]";
break;
}
}
?>

and i am really2x confused on how will i convert that into CI code.. im really confuse on CI's Sessions ... Please help... ^_^


TOTAL NEWBIE PLEASE HELP - El Forum - 10-06-2008

[eluser]sHoyRu777[/eluser]
especially this part $_SESSION['product'][$_GET['product_id']]++;


TOTAL NEWBIE PLEASE HELP - El Forum - 10-06-2008

[eluser]Dan Bowling[/eluser]
The first thing to understand is that CodeIgniter uses it's own session data, not the native PHP sessions.

Have you looked at http://ellislab.com/codeigniter/user-guide/libraries/sessions.html already in the user guide?

If you have, can you post some code for what you are already trying that isn't working?


TOTAL NEWBIE PLEASE HELP - El Forum - 10-07-2008

[eluser]sHoyRu777[/eluser]
yes, ive already read that.. ahm i just want to convert this native php code to a CI code -->> $_SESSION['product'][$_GET['product_id']]++ ... if you could just please help me convert it to CI code then im done.. coz the ++ sign wont work on CI... ive tried everthing that i can possible think of but ends up stock...


TOTAL NEWBIE PLEASE HELP - El Forum - 10-07-2008

[eluser]wiredesignz[/eluser]
Hi, can you show the CI code you have made that is causing the problem, Thanks.