TOTAL NEWBIE PLEASE HELP |
[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... ^_^
[eluser]sHoyRu777[/eluser]
especially this part $_SESSION['product'][$_GET['product_id']]++;
[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-gui...sions.html already in the user guide? If you have, can you post some code for what you are already trying that isn't working?
[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...
[eluser]wiredesignz[/eluser]
Hi, can you show the CI code you have made that is causing the problem, Thanks. |
Welcome Guest, Not a member yet? Register Sign In |