I'm trying to use sessions in another little shopping thing. It all takes place like this:
First you login(I got that to work), then you declare the items in the store(only three items - it's a small store 😃 ) as well as their prices. Those items get "carried over" to the next form and then you choose the items you would like to purchase. When you submit the form, you get taken to the last page where you are supposed to be shown something like this:
==============================================
You have selected the following:
3 X Apples, at a cost of : R 21
6 X Pears, at a cost of : R 12
2 X Grapes, at a cost of : R 14
Total : R 33
==============================================
("R" being our currency in South Africa: Rand - aka: Monopoly Money)
But instead of printing "Apples" and so on, it prints "on". I'm completely "bowled over" by this, as I can't explain or sort it out. Throwing things around the room also doesn't seem to help. 😃
A bit of the code I'm using (boring and irrelavant parts - according to me - have been let out) looks like this:
session_register("item1check1, ....");
//a bit of boring and irrelavant code
Item 1: <input type=text name=item1>
Price: <input type=text name=price1><br>
//bla bla bla
$item1check = $item1;
//some irrelavant code
print("<input type=checkbox name=item1check> $item1<br>
Units needed: <input type=text name=units1><br>");
//more irrelavant code
if ($item1check)
{
$cost1 = $price1 * $units1;
print("$units1 X $item1check, at a cost of : R $cost1<br>");
$total += $cost1;
}
//a little irrelavant code
Excuse me for posting such a long thread.:rolleyes:
Thanks for your help(in advance, of course) 🙂